Network/SocketPoller: Fix behavior of Wait method (-1 will block)

This commit is contained in:
Jérôme Leclercq
2017-08-04 13:37:17 +02:00
parent adf7bb15cf
commit 3d368b2fe7
8 changed files with 10 additions and 10 deletions

View File

@@ -129,7 +129,7 @@ namespace Nz
#endif
}
int SocketPollerImpl::Wait(UInt64 msTimeout, SocketError* error)
int SocketPollerImpl::Wait(int msTimeout, SocketError* error)
{
int activeSockets;
@@ -179,7 +179,7 @@ namespace Nz
tv.tv_sec = static_cast<long>(msTimeout / 1000ULL);
tv.tv_usec = static_cast<long>((msTimeout % 1000ULL) * 1000ULL);
activeSockets = ::select(0xDEADBEEF, readSet, writeSet, nullptr, (msTimeout > 0) ? &tv : nullptr); //< The first argument is ignored on Windows
activeSockets = ::select(0xDEADBEEF, readSet, writeSet, nullptr, (msTimeout >= 0) ? &tv : nullptr); //< The first argument is ignored on Windows
if (activeSockets == SOCKET_ERROR)
{
if (error)