struct {
unsigned enobufs;
unsigned overrun;
+ unsigned lost;
} stats;
int num_interfaces = 0;
pthread_create(&thread, 0, measure_thread, NULL);
- struct timespec next, now, diff;
+ struct timespec next, now, diff, allsent = {0,0};
clock_gettime(CLOCK_MONOTONIC, &next);
int completed = 0;
while (!finish_flag && (opt.count == 0 || completed < opt.count)) {
next.tv_sec++;
}
}
+ if (opt.count != 0 && count >= opt.count) {
+ if (allsent.tv_sec == 0)
+ allsent = now;
+ timespec_subtract(&diff, &now, &allsent);
+ if (diff.tv_sec >= 1)
+ finish_flag = 1;
+ }
}
print_progress();
printf("\n");
+ stats.lost = msg_in_progress;
+
pthread_join(thread, NULL);
close(completion_pipe[0]);
printf("overrun=%d\n", stats.overrun);
if (stats.enobufs)
printf("enobufs=%d\n", stats.enobufs);
+ if (stats.lost)
+ printf("lost=%d\n", stats.lost);
return 0;
}