src/socket_io.cpp
// Uses select() to see if there is anything readable on the socket.
Uses select() to see if there is anything readable on the socket.
Uses select () to see if there is anything readable on the socket .
bool SocketIO::WaitForReadable(int secs) const {
  fd_set fds;
  FD_ZERO(&fds);
  FD_SET(fd_, &fds);
  struct timeval tv;
  tv.tv_sec = secs;
  tv.tv_usec = 0;
  return (select(fd_ + 1, &fds, NULL, NULL, &tv) == 1);
}
bool SocketIO :: WaitForReadable ( int secs ) const { fd_set fds ; FD_ZERO ( & fds ) ; FD_SET ( fd_ , & fds ) ; struct timeval tv ; tv . tv_sec = secs ; tv . tv_usec = 0 ; return ( select ( fd_ + 1 , & fds , NULL , NULL , & tv ) == 1 ) ; }
Uses select() to see if there is anything readable on the socket.
Uses select () to see if there is anything readable on the socket .