diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-23 16:39:15 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-23 16:39:15 +0000 |
commit | 076a6189e13a11608dada8199f24eab96d0cba96 (patch) | |
tree | 7805a953581662cdd148915b7be97f3d9679afbe /examples | |
parent | 25d1019123701e93d89289a4c1504337fef7db82 (diff) | |
download | ATCD-076a6189e13a11608dada8199f24eab96d0cba96.tar.gz |
checkin of Doug's change: added sleep to keep reading until the client shuts down
Diffstat (limited to 'examples')
-rw-r--r-- | examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp index d99f4c985ec..71f9138be90 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp @@ -1,7 +1,6 @@ // This example tests the non-blocking features of the -// $Id$ - // ACE_SOCK_Acceptor and ACE_SOCK_Stream classes. +// $Id$ #include "ace/Log_Msg.h" #include "ace/SOCK_Acceptor.h" @@ -81,13 +80,19 @@ main (int argc, char *argv[]) for (ssize_t r_bytes;;) { + // Wait to read until there's something from the client. if (ACE_OS::select (int (new_stream.get_handle ()) + 1, handle_set, 0, 0, 0) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "select"), -1); + // Keep reading until the client shuts down. for (;;) { + // Sleep for some amount of time in order + // to test client flow control. + ACE_OS::sleep (SOME_RANDOM_TIME_SET_BY_COMMAND_LINE); + r_bytes = new_stream.recv (buf, sizeof buf); if (r_bytes <= 0) |