MCPcopy Create free account
hub / github.com/esnet/iperf / server_timer_proc

Function server_timer_proc

src/iperf_server_api.c:317–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static void
318server_timer_proc(TimerClientData client_data, struct iperf_time *nowP)
319{
320 struct iperf_test *test = client_data.p;
321 struct iperf_stream *sp;
322 int32_t err;
323
324 test->timer = NULL;
325 if (test->done)
326 return;
327 test->done = 1;
328 iperf_err(test, "error - server test duration expired - test is terminated by the server");
329 if (iperf_set_send_state(test, SERVER_ERROR) == 0) {
330 i_errno = IESERVERTESTDURATIONEXPIRED;
331 err = htonl(i_errno);
332 if (Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) == sizeof(err)) {
333 err = 0;
334 Nwrite(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp);
335 };
336 }
337 /* Free streams */
338 while (!SLIST_EMPTY(&test->streams)) {
339 sp = SLIST_FIRST(&test->streams);
340 if (sp->socket != -1) {
341 SLIST_REMOVE_HEAD(&test->streams, streams);
342 close(sp->socket);
343 sp->socket = -1;
344 iperf_free_stream(sp);
345 }
346 }
347 close(test->ctrl_sck);
348 test->ctrl_sck = -1;
349}
350
351static void
352server_stats_timer_proc(TimerClientData client_data, struct iperf_time *nowP)

Callers

nothing calls this directly

Calls 4

iperf_errFunction · 0.85
iperf_set_send_stateFunction · 0.85
NwriteFunction · 0.85
iperf_free_streamFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…