Network/SocketPoller: Uniformize behavior accross platforms
On Windows, a closed connection will mark as ready for read/write
This commit is contained in:
@@ -143,12 +143,12 @@ namespace Nz
|
||||
int socketRemaining = activeSockets;
|
||||
for (PollSocket& entry : m_sockets)
|
||||
{
|
||||
if (entry.revents != 0)
|
||||
if (entry.revents & (POLLRDNORM | POLLWRNORM | POLLHUP | POLLERR))
|
||||
{
|
||||
if (entry.revents & POLLRDNORM)
|
||||
if (entry.revents & (POLLRDNORM | POLLHUP | POLLERR))
|
||||
m_readyToReadSockets.insert(entry.fd);
|
||||
|
||||
if (entry.revents & POLLWRNORM)
|
||||
if (entry.revents & (POLLWRNORM | POLLERR))
|
||||
m_readyToWriteSockets.insert(entry.fd);
|
||||
|
||||
entry.revents = 0;
|
||||
@@ -156,6 +156,11 @@ namespace Nz
|
||||
if (--socketRemaining == 0)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
NazaraWarning("Socket " + String::Number(entry.fd) + " was returned by WSAPoll without POLLRDNORM nor POLLWRNORM events (events: 0x" + String::Number(entry.events, 16) + ')');
|
||||
activeSockets--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user