From: Holger Schemel Date: Thu, 31 May 2018 11:15:57 +0000 (+0200) Subject: code cleanup (handling of network socket activity) X-Git-Tag: 4.1.1.0~125 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=fe81860be6d728f992a7ce5af51d6b7e84e2136e;p=rocksndiamonds.git code cleanup (handling of network socket activity) --- diff --git a/src/netserv.c b/src/netserv.c index 71b23c95..7c38ceed 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -452,7 +452,6 @@ int NetworkServerThread(void *ptr) void NetworkServer(int port, int serveronly) { - int sl; struct NetworkServerPlayerInfo *player; int r; unsigned int len; @@ -507,17 +506,8 @@ void NetworkServer(int port, int serveronly) for (player = first_player; player; player = player->next) flushuser(player); - if ((sl = SDLNet_CheckSockets(fds, 500000)) < 1) - { - Error(ERR_NETWORK_SERVER, "SDLNet_CheckSockets failed: %s", - SDLNet_GetError()); - perror("SDLNet_CheckSockets"); - } - - if (sl < 0) - continue; - - if (sl == 0) + // wait for 100 ms for activity on open network sockets + if (SDLNet_CheckSockets(fds, 100) < 1) continue; /* accept incoming connections */