Network/SocketPoller: Wait() now returns the number of active sockets, and optionally the last error

It will also ignore the EINTR error on Linux
This commit is contained in:
Jérôme Leclercq
2018-06-12 14:31:49 +02:00
parent 15f84dc712
commit 56b23a2f27
16 changed files with 120 additions and 94 deletions

View File

@@ -78,6 +78,7 @@ namespace Nz
SocketError_ConnectionRefused, //< The connection attempt was refused
SocketError_DatagramSize, //< The datagram size is over the system limit
SocketError_Internal, //< The error is coming from the engine
SocketError_Interrupted, //< The operation was interrupted by a signal
SocketError_Packet, //< The packet encoding/decoding failed, probably because of corrupted data
SocketError_NetworkError, //< The network system has failed (maybe network is down)
SocketError_NotInitialized, //< Nazara network has not been initialized

View File

@@ -31,7 +31,7 @@ namespace Nz
bool RegisterSocket(AbstractSocket& socket, SocketPollEventFlags eventFlags);
void UnregisterSocket(AbstractSocket& socket);
bool Wait(int msTimeout);
unsigned int Wait(int msTimeout, SocketError* error = nullptr);
SocketPoller& operator=(SocketPoller&&) noexcept = default;