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

Function create_client_timers

src/iperf_client_api.c:211–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211static int
212create_client_timers(struct iperf_test * test)
213{
214 struct iperf_time now;
215 TimerClientData cd;
216 if (NULL == test)
217 {
218 iperf_err(NULL, "No test\n");
219 i_errno = IEINITTEST;
220 return -1;
221 }
222
223 if (iperf_time_now(&now) < 0) {
224 i_errno = IEINITTEST;
225 return -1;
226 }
227 cd.p = test;
228 test->timer = test->stats_timer = test->reporter_timer = NULL;
229 if (test->duration != 0) {
230 test->done = 0;
231 test->timer = tmr_create(&now, test_timer_proc, cd, ( test->duration + test->omit ) * SEC_TO_US, 0);
232 if (test->timer == NULL) {
233 i_errno = IEINITTEST;
234 return -1;
235 }
236 }
237 if (test->stats_interval != 0) {
238 test->stats_timer = tmr_create(&now, client_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1);
239 if (test->stats_timer == NULL) {
240 i_errno = IEINITTEST;
241 return -1;
242 }
243 }
244 if (test->reporter_interval != 0) {
245 test->reporter_timer = tmr_create(&now, client_reporter_timer_proc, cd, test->reporter_interval * SEC_TO_US, 1);
246 if (test->reporter_timer == NULL) {
247 i_errno = IEINITTEST;
248 return -1;
249 }
250 }
251 return 0;
252}
253
254static void
255client_omit_timer_proc(TimerClientData client_data, struct iperf_time *nowP)

Callers 1

Calls 3

iperf_errFunction · 0.85
iperf_time_nowFunction · 0.85
tmr_createFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…