1
0

ProtoProxy: Fixed connection on *nix.

This commit is contained in:
madmaxoft 2014-01-24 18:51:15 +01:00
parent e75f979e01
commit d8014d1ed8

View File

@ -243,7 +243,8 @@ void cConnection::Run(void)
FD_ZERO(&ReadFDs); FD_ZERO(&ReadFDs);
FD_SET(m_ServerSocket, &ReadFDs); FD_SET(m_ServerSocket, &ReadFDs);
FD_SET(m_ClientSocket, &ReadFDs); FD_SET(m_ClientSocket, &ReadFDs);
int res = select(2, &ReadFDs, NULL, NULL, NULL); SOCKET MaxSocket = std::max(m_ServerSocket, m_ClientSocket);
int res = select(MaxSocket + 1, &ReadFDs, NULL, NULL, NULL);
if (res <= 0) if (res <= 0)
{ {
printf("select() failed: %d; aborting client", SocketError); printf("select() failed: %d; aborting client", SocketError);