src/worker.cc
// Wait for a connection from a network traffic generation thread.
Wait for a connection from a network traffic generation thread.
Wait for a connection from a network traffic generation thread .
bool NetworkListenThread::Wait() {
    fd_set rfds;
    struct timeval tv;
    int retval;
    FD_ZERO(&rfds);
    FD_SET(sock_, &rfds);
    tv.tv_sec = 5;
    tv.tv_usec = 0;
    retval = select(sock_ + 1, &rfds, NULL, NULL, &tv);
    return (retval > 0);
}
bool NetworkListenThread :: Wait ( ) { fd_set rfds ; struct timeval tv ; int retval ; FD_ZERO ( & rfds ) ; FD_SET ( sock_ , & rfds ) ; tv . tv_sec = 5 ; tv . tv_usec = 0 ; retval = select ( sock_ + 1 , & rfds , NULL , NULL , & tv ) ; return ( retval > 0 ) ; }
Wait for a connection from a network traffic generation thread.
Wait for a connection from a network traffic generation thread .
// Watch sock_ to see when it has input. // Wait up to five seconds.