fd_set fds;
FD_ZERO(&fds);
for ( ;; ) {
+ timeval tv = { 1, 0 };
FD_SET(gre.fd(), &fds);
FD_SET(tun.fd(), &fds);
- int ret = select(1024, &fds, NULL, NULL, NULL);
+ tun_reorderer.possibly_adjust_tv(&tv);
+ tun_pacer.possibly_adjust_tv(&tv);
+ int ret = select(1024, &fds, NULL, NULL, &tv);
if (ret == -1) {
perror("select");
continue;
if (FD_ISSET(tun.fd(), &fds)) {
tun.read_packet(&gre_pacer);
}
+ tun_pacer.possibly_flush_packets();
}
}