From 5a7d5ee4c0831d666233535ae8856684310c69ba Mon Sep 17 00:00:00 2001 From: goodale Date: Sat, 16 Sep 2000 20:10:28 +0000 Subject: Added ability to pause and terminate the simulation. Also can select how many iterations between steering events. Can now start simulation as 'standalone' twiddle with parameters, then start the simulation, pause it, and kill it. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@31 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Sockets.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/Sockets.c') 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) -- cgit v1.2.3