Skip to content
Permalink
Browse files

Merge pull request #4 from polserver/master

Quick workaround to avoid crashing POL when too many connections are …
  • Loading branch information...
nogu3ira committed Feb 21, 2019
2 parents ca04166 + 8d0909c commit 88c1ff8391cddd2d5548d8ec5d27e1bd795baeca
Showing with 10 additions and 4 deletions.
  1. +10 −4 pol-core/pol/network/clientthread.cpp
@@ -102,10 +102,16 @@ bool client_io_thread( Network::Client* client, bool login )

// Non-Winsock implementations require nfds to be the largest socket value + 1
#ifndef _WIN32
passert_r(
clientSocket < FD_SETSIZE,
"Select() implementation in Linux cant handle this many sockets at the same time." )
nfds = clientSocket + 1;
if ( clientSocket < FD_SETSIZE )
{
nfds = clientSocket + 1;
}
else
{
client->forceDisconnect();
throw std::runtime_error(
"Select() implementation on Linux cant handle this many sockets at the same time." );
}
#endif

FD_SET( clientSocket, &c_recv_fd );

0 comments on commit 88c1ff8

Please sign in to comment.
You can’t perform that action at this time.