1
1

Exit if idle time expires waiting for a connection in one-off mode. #1187 (#1197)

Этот коммит содержится в:
Mark Feit 2021-09-02 17:20:26 -04:00 коммит произвёл GitHub
родитель 709f552cf7
Коммит 775341de11
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -195,7 +195,13 @@ run in server mode
run the server in background as a daemon run the server in background as a daemon
.TP .TP
.BR -1 ", " --one-off .BR -1 ", " --one-off
handle one client connection, then exit. handle one client connection, then exit. If an idle time is set, the
server will exit after that amount of time with no connection.
.TP
.BR --idle-timeout " \fIn\fR"
restart the server after \fIn\fR seconds in case it gets stuck. In
one-off mode, this is the number of seconds the server will wait
before exiting.
.TP .TP
.BR --server-bitrate-limit " \fIn\fR[KMGT]" .BR --server-bitrate-limit " \fIn\fR[KMGT]"
set a limit on the server side, which will cause a test to abort if set a limit on the server side, which will cause a test to abort if

Просмотреть файл

@ -525,6 +525,13 @@ iperf_run_server(struct iperf_test *test)
printf("Server restart (#%d) in idle state as no connection request was received for %d sec\n", printf("Server restart (#%d) in idle state as no connection request was received for %d sec\n",
test->server_forced_idle_restarts_count, test->settings->idle_timeout); test->server_forced_idle_restarts_count, test->settings->idle_timeout);
cleanup_server(test); cleanup_server(test);
if ( iperf_get_test_one_off(test) ) {
if (test->debug)
printf("No connection request was received for %d sec in one-off mode; exiting.\n",
test->settings->idle_timeout);
exit(0);
}
return 2; return 2;
} }
} }