version 1.3 | | version 1.4 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_loop_c = | | * static char *rcsid_loop_c = |
* "$Id: loop.c,v 1.3 2000/05/21 21:41:46 jec Exp $"; | | * "$Id: loop.c,v 1.4 2000/11/14 07:35:06 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
static void block_until_new_connection() | | static void block_until_new_connection() |
{ | | { |
| | |
#ifdef WATCHDOG | | |
struct timeval Timeout; | | struct timeval Timeout; |
fd_set readfs; | | fd_set readfs; |
| | int cycles; |
| | |
LOG(llevInfo, "Waiting for connections...\n"); | | LOG(llevInfo, "Waiting for connections...\n"); |
| | |
| | cycles=0; |
do { | | do { |
| | /* Every minutes is a bit often for updates - especially if nothing is going |
| | * on. This slows it down to every 5 minutes. |
| | */ |
| | if (cycles++ == 5) { |
| | metaserver_update(); |
| | cycles=0; |
| | } |
FD_ZERO(&readfs); | | FD_ZERO(&readfs); |
FD_SET(init_sockets[0].fd, &readfs); | | FD_SET(init_sockets[0].fd, &readfs); |
Timeout.tv_sec=60; | | Timeout.tv_sec=60; |
Timeout.tv_usec=0; | | Timeout.tv_usec=0; |
| | #ifdef WATCHDOG |
watchdog(); | | watchdog(); |
| | #endif |
} | | } |
while (select(socket_info.max_filedescriptor, &readfs, NULL, NULL, &Timeout)==0); | | while (select(socket_info.max_filedescriptor, &readfs, NULL, NULL, &Timeout)==0); |
#else | | |
fd_set readfs; | | |
| | |
LOG(llevInfo, "Waiting for connections...\n"); | | |
| | |
FD_ZERO(&readfs); | | |
FD_SET(init_sockets[0].fd, &readfs); | | |
(void) select(socket_info.max_filedescriptor, &readfs, NULL, NULL, NULL); | | |
#endif | | |
reset_sleep(); /* Or the game would go too fast */ | | reset_sleep(); /* Or the game would go too fast */ |
} | | } |
| | |