|
|
@ -21,7 +21,11 @@ Poll::Poll( StreamConnection *connection,
|
|
|
|
, m_num_of_fds(0)
|
|
|
|
, m_num_of_fds(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE;
|
|
|
|
TRACE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We could initialize each .events = -1 so poll would skip them
|
|
|
|
m_fds = new pollfd[m_maxclients+1]; // plus the server socket
|
|
|
|
m_fds = new pollfd[m_maxclients+1]; // plus the server socket
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addFd( m_connection->getSocket(), POLLIN | POLLPRI );
|
|
|
|
addFd( m_connection->getSocket(), POLLIN | POLLPRI );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -40,7 +44,7 @@ void Poll::startPolling()
|
|
|
|
m_polling = true;
|
|
|
|
m_polling = true;
|
|
|
|
while ( m_polling ) {
|
|
|
|
while ( m_polling ) {
|
|
|
|
|
|
|
|
|
|
|
|
int ret = poll( m_fds , m_maxclients, m_timeOut);
|
|
|
|
int ret = poll( m_fds , m_num_of_fds, m_timeOut);
|
|
|
|
|
|
|
|
|
|
|
|
if ( ret == -1 ) {
|
|
|
|
if ( ret == -1 ) {
|
|
|
|
LOG( Logger::ERR, errnoToString("ERROR polling. ").c_str() );
|
|
|
|
LOG( Logger::ERR, errnoToString("ERROR polling. ").c_str() );
|
|
|
|