diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-01 16:43:24 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-01 16:43:24 +0000 |
commit | b462a7a9d307c5f5eff30a24008045c0e3d0185a (patch) | |
tree | a9efcb39b9e041e5cf70e17090c76df8b5354b47 /examples/IPC_SAP/SPIPE_SAP/NPServer.cpp | |
parent | 7e1358bc65c1d08e3ba99af5b7e5869e1cd2c47f (diff) | |
download | ATCD-TAO-1_1_7.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_1_7'.TAO-1_1_7
Diffstat (limited to 'examples/IPC_SAP/SPIPE_SAP/NPServer.cpp')
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/NPServer.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp b/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp deleted file mode 100644 index f13cfa0fef9..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Acceptor.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(SPIPE_SAP, NPServer, "$Id$") - -#if defined (ACE_WIN32) -#define MAKE_PIPE_NAME(X) \\\\.\\pipe\\#X -#else -#define MAKE_PIPE_NAME(X) X -#endif - -int -main (int /* argc */, char * /* argv */ []) -{ - ACE_SPIPE_Acceptor acceptor; - ACE_SPIPE_Stream new_stream; - char buf[BUFSIZ]; - int n; - const char *pipe_name = "acepipe"; - const char *rendezvous = MAKE_PIPE_NAME (pipe_name); - - // Initialize named pipe listener. - - if (acceptor.open (ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - - "open"), 1); - - for (;;) - { - ACE_DEBUG ((LM_DEBUG, - "waiting for connection\n")); - - // Accept a client connection. - if (acceptor.accept (new_stream, 0) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "accept"), - 1); - - ACE_DEBUG ((LM_DEBUG, - "Accepted connection\n")); - - while ((n = new_stream.recv (buf, sizeof buf)) > 0) - { - ACE_OS::fprintf (stderr, - "%s\n", - buf); - ACE_OS::write (ACE_STDOUT, - buf, - n); - } - - if (n == -1) - { - ACE_DEBUG ((LM_DEBUG, - "End of connection. Closing handle\n")); - new_stream.close (); - } - } - - ACE_NOTREACHED(return 0); -} |