UDP socket implementation.

This commit is contained in:
Adam Ierymenko 2014-03-17 16:18:44 -07:00
parent 8adbbe092d
commit 1a0a6755b1
4 changed files with 127 additions and 7 deletions

View file

@ -434,10 +434,20 @@ void SocketManager::poll(unsigned long timeout)
}
}
for(std::vector< SharedPtr<Socket> >::iterator s(ts.begin());s!=ts.end();++s) {
if (FD_ISSET((*s)->_sock,&rfds))
(*s)->notifyAvailableForRead(*s,this);
if (FD_ISSET((*s)->_sock,&wfds))
(*s)->notifyAvailableForWrite(*s,this);
if (FD_ISSET((*s)->_sock,&wfds)) {
if (!(*s)->notifyAvailableForWrite(*s,this)) {
Mutex::Lock _l2(_tcpSockets_m);
_tcpSockets.erase(((TcpSocket *)s->ptr())->_remote);
continue;
}
}
if (FD_ISSET((*s)->_sock,&rfds)) {
if (!(*s)->notifyAvailableForRead(*s,this)) {
Mutex::Lock _l2(_tcpSockets_m);
_tcpSockets.erase(((TcpSocket *)s->ptr())->_remote);
continue;
}
}
}
}