Logo Search packages:      
Sourcecode: znc version File versions  Download package

int Csock::ReadSelect (  )  [virtual]

ReadSelect on this socket Only good if JUST using this socket, otherwise use the TSocketManager

Definition at line 594 of file Csocket.cpp.

References SEL_EAGAIN, SEL_ERR, SEL_OK, and SEL_TIMEOUT.

Referenced by Read().

{
      if ( m_iReadSock < 0 )
            return( SEL_ERR );

      struct timeval tv;
      fd_set rfds;

      TFD_ZERO( &rfds );
      TFD_SET( m_iReadSock, &rfds );

      tv.tv_sec = m_itimeout;
      tv.tv_usec = 0;

      int ret = select( FD_SETSIZE, &rfds, NULL, NULL, &tv );

      if ( ret == 0 )
            return( SEL_TIMEOUT );

      if ( ret == -1 )
      {
            if ( GetSockError() == EINTR )
                  return( SEL_EAGAIN );
            else
                  return( SEL_ERR );
      }

      return( SEL_OK );
}


Generated by  Doxygen 1.6.0   Back to index