diff options
Diffstat (limited to 'src/Sockets.c')
-rw-r--r-- | src/Sockets.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index e7f5c93..8891729 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -165,11 +165,21 @@ int HTTP_Poll(cGH *cctkGH, long sec, long usec) struct sockaddr_in clientname; struct timeval timeout; + struct timeval *real_timeout; - timeout.tv_sec = sec; - timeout.tv_usec = usec; + if(sec >=0) + { + timeout.tv_sec = sec; + timeout.tv_usec = usec; + + real_timeout = &timeout; + } + else + { + real_timeout = NULL; + } - /* Block until input arrives on one or more active sockets. */ + /* Check if any input is available on one or more active sockets. */ read_fd_set = active_fd_set; if (select (FD_SETSIZE, &read_fd_set, NULL, NULL, &timeout) < 0) |