diff options
author | goodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2000-09-16 20:10:28 +0000 |
---|---|---|
committer | goodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2000-09-16 20:10:28 +0000 |
commit | 5a7d5ee4c0831d666233535ae8856684310c69ba (patch) | |
tree | 06cf1048e853380e00b8d6ce0565a72fd923cf08 /src/Sockets.c | |
parent | 26bf3412fc4693fc7d61598a542b66e375353abc (diff) |
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
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) |