diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
commit | 437eea6fa08e931864f89be91d14a816f69075c7 (patch) | |
tree | b8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /examples/IPC_SAP/SPIPE_SAP | |
parent | ea0d28240863caf437a18071bfd03e7b146c5ade (diff) | |
download | ATCD-unlabeled-4.2.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
Diffstat (limited to 'examples/IPC_SAP/SPIPE_SAP')
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/Makefile | 226 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/NPClient.cpp | 46 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/NPServer.cpp | 54 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/client.cpp | 42 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp | 53 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp | 50 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp | 52 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/producer_read.cpp | 49 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/server.cpp | 116 | ||||
-rw-r--r-- | examples/IPC_SAP/SPIPE_SAP/shared.h | 6 |
10 files changed, 0 insertions, 694 deletions
diff --git a/examples/IPC_SAP/SPIPE_SAP/Makefile b/examples/IPC_SAP/SPIPE_SAP/Makefile deleted file mode 100644 index b95818890e2..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/Makefile +++ /dev/null @@ -1,226 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for the simple STREAM pipe client/server test file -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = client \ - server \ - consumer_msg \ - consumer_read \ - producer_msg \ - producer_read \ - NPClient \ - NPServer - -LSRC = $(addsuffix .cpp,$(BIN)) - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU -include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/client.o .shobj/client.so: client.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i \ - shared.h -.obj/server.o .shobj/server.so: server.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - shared.h -.obj/consumer_msg.o .shobj/consumer_msg.so: consumer_msg.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - shared.h -.obj/consumer_read.o .shobj/consumer_read.so: consumer_read.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - shared.h -.obj/producer_msg.o .shobj/producer_msg.so: producer_msg.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i \ - shared.h -.obj/producer_read.o .shobj/producer_read.so: producer_read.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i \ - shared.h -.obj/NPClient.o .shobj/NPClient.so: NPClient.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Connector.i -.obj/NPServer.o .shobj/NPServer.so: NPServer.cpp \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/Addr.h \ - $(WRAPPER_ROOT)/ace/ACE.h \ - $(WRAPPER_ROOT)/ace/OS.h \ - $(WRAPPER_ROOT)/ace/Time_Value.h \ - $(WRAPPER_ROOT)/ace/config.h \ - $(WRAPPER_ROOT)/ace/stdcpp.h \ - $(WRAPPER_ROOT)/ace/Trace.h \ - $(WRAPPER_ROOT)/ace/Log_Msg.h \ - $(WRAPPER_ROOT)/ace/Log_Record.h \ - $(WRAPPER_ROOT)/ace/Log_Priority.h \ - $(WRAPPER_ROOT)/ace/Log_Record.i \ - $(WRAPPER_ROOT)/ace/ACE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.h \ - $(WRAPPER_ROOT)/ace/IPC_SAP.i \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp b/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp deleted file mode 100644 index a4594064882..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp +++ /dev/null @@ -1,46 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" - -#if defined (ACE_WIN32) -#define MAKE_PIPE_NAME(X) \\\\.\\pipe\\#X -#else -#define MAKE_PIPE_NAME(X) X -#endif - -const int DEFAULT_SIZE = 8; -const int DEFAULT_COUNT = 10000; - -int -main (int argc, char *argv[]) -{ - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; - char *buf = new char[size]; - - //char *pipe_name = ACE_DEFAULT_RENDEZVOUS; - char *pipe_name = "acepipe"; - char *rendezvous; - rendezvous = MAKE_PIPE_NAME (pipe_name); - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - int i; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), -1); - - ACE_OS::strcpy (buf, "hello"); - size = ACE_OS::strlen (buf) + 1; - - for (i = 0; i < iterations; i++) - if (cli_stream.send (buf, size) != size) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "putmsg"), -1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1); - - return 0; -} diff --git a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp b/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp deleted file mode 100644 index 5a122fefc14..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp +++ /dev/null @@ -1,54 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/Time_Value.h" -#include "ace/SPIPE_Acceptor.h" - -#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; - // char *pipe_name = ACE_DEFAULT_RENDEZVOUS; - char *pipe_name = "acepipe"; - - char *rendezvous; - 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) - { - cerr << buf << endl; - ACE_OS::write (ACE_STDOUT, buf, n); - } - if (n == -1) - { - ACE_DEBUG ((LM_DEBUG, "End of connection. Closing handle\n")); - new_stream.close (); - } - } - return 0; -} diff --git a/examples/IPC_SAP/SPIPE_SAP/client.cpp b/examples/IPC_SAP/SPIPE_SAP/client.cpp deleted file mode 100644 index 20d3caa4765..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/client.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int argc, char *argv[]) -{ - if (argc < 2) - ACE_ERROR_RETURN ((LM_ERROR, "usage: %s string [rendezvous]\n", argv[0]), 1); - - if (argc > 2) - rendezvous = argv[2]; - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), 1); - - size_t len = ACE_OS::strlen (argv[1]) + 1; - - if (cli_stream.send (argv[1], len) != len) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp b/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp deleted file mode 100644 index 85d6339a0f6..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp +++ /dev/null @@ -1,53 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Acceptor.h" -#include "ace/Time_Value.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor peer_acceptor; - ACE_SPIPE_Stream new_stream; - char buf[BUFSIZ]; - ACE_Str_Buf buffer (buf, 0, sizeof buf); - int flags = 0; - - if (argc > 1) - rendezvous = argv[1]; - - ACE_OS::unlink (rendezvous); - ACE_OS::fdetach (rendezvous); - - ACE_SPIPE_Addr addr (rendezvous); - ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); - - if (peer_acceptor.open (addr) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); - - ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); - - if (peer_acceptor.accept (new_stream, 0, &timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "accept"), 1); - - ACE_DEBUG ((LM_DEBUG, "accepted\n")); - - while (new_stream.recv ((ACE_Str_Buf *) 0, &buffer, &flags) >= 0) - if (buffer.len == 0) - break; - else - ACE_OS::write (ACE_STDOUT, buffer.buf, buffer.len); - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp b/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp deleted file mode 100644 index d6ca116b5db..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp +++ /dev/null @@ -1,50 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Acceptor.h" -#include "ace/Time_Value.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor peer_acceptor; - ACE_SPIPE_Stream new_stream; - char buf[BUFSIZ]; - int n; - - // Wait up to ACE_DEFAULT_TIMEOUT seconds to accept connection. - ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); - - if (argc > 1) - rendezvous = argv[1]; - - ACE_OS::unlink (rendezvous); - ACE_OS::fdetach (rendezvous); - - if (peer_acceptor.open (ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1); - - ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); - - if (peer_acceptor.accept (new_stream, 0, &timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "accept"), 1); - - ACE_DEBUG ((LM_DEBUG, "accepted\n")); - - while ((n = new_stream.recv (buf, sizeof buf)) > 0) - ACE_OS::write (ACE_STDOUT, buf, n); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp b/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp deleted file mode 100644 index e2f2940e75f..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp +++ /dev/null @@ -1,52 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -const int DEFAULT_SIZE = 4 * 1024; -const int DEFAULT_COUNT = 100; - -int -main (int argc, char *argv[]) -{ - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; - char *buf = new char[size]; - - if (argc > 3) - rendezvous = argv[3]; - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - int i; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), 1); - - for (i = 0; i < size; i++) - buf[i] = 'a'; - - ACE_Str_Buf buffer (buf, size); - - for (i = 0; i < iterations; i++) - if (cli_stream.send ((ACE_Str_Buf *) 0, &buffer) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); - - delete buf; - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp b/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp deleted file mode 100644 index 033dacb04ab..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp +++ /dev/null @@ -1,49 +0,0 @@ - -// $Id$ - -#include "ace/SPIPE_Addr.h" -#include "ace/SPIPE_Connector.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -const int DEFAULT_SIZE = 8 * 1024; -const int DEFAULT_COUNT = 100; - -int -main (int argc, char *argv[]) -{ - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; - char *buf = new char[size]; - - if (argc > 3) - rendezvous = argv[3]; - - ACE_SPIPE_Stream cli_stream; - ACE_SPIPE_Connector con; - int i; - - if (con.connect (cli_stream, ACE_SPIPE_Addr (rendezvous)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", rendezvous), -1); - - for (i = 0; i < size; i++) - buf[i] = 'a'; - - for (i = 0; i < iterations; i++) - if (cli_stream.send (buf, size) != size) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "putmsg"), -1); - - if (cli_stream.close () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1); - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "this feature is not supported"), -1); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/server.cpp b/examples/IPC_SAP/SPIPE_SAP/server.cpp deleted file mode 100644 index 2d46a882f8a..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/server.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "ace/SPIPE_Addr.h" -// $Id$ - -#include "ace/SPIPE_Acceptor.h" -#include "shared.h" - -#if defined (ACE_HAS_STREAM_PIPES) - -/* Maximum per-process open I/O descriptors */ -const int MAX_FDS = 200; -const int PERMS = 0666; - -int -main (int argc, char *argv[]) -{ - ACE_SPIPE_Acceptor peer_acceptor; - ACE_SPIPE_Stream new_stream; - int s_handle; - struct pollfd poll_array[MAX_FDS]; - - if (argc > 1) - rendezvous = argv[1]; - - ACE_OS::fdetach (rendezvous); - - ACE_SPIPE_Addr addr (rendezvous); - - if ((s_handle = peer_acceptor.open (addr)) == -1) - ACE_OS::perror ("peer_acceptor.open"), ACE_OS::exit (1); - - for (int fd = 0; fd < MAX_FDS; fd++) - { - poll_array[fd].fd = -1; - poll_array[fd].events = POLLIN; - } - - poll_array[0].fd = s_handle; - - for (int width = 1;;) - { - // Block waiting for client I/O events (handle interrupts). - while (ACE_OS::poll (poll_array, width) == -1 && errno == EINTR) - continue; - - /* Handle pending logging messages first (s_handle + 1 - is guaranteed to be lowest client descriptor) */ - - for (int fd = s_handle + 1; fd < width; fd++) - if ((poll_array[fd].revents & POLLIN) - || (poll_array[fd].revents & POLLHUP)) - { - char buf[BUFSIZ]; - int n; - - /* recv will not block in this case! */ - if ((n = ACE_OS::read (fd, buf, sizeof buf)) == -1) - ACE_OS::perror ("read failed"); - else if (n == 0) - { - /* Handle client connection shutdown */ - if (ACE_OS::close (poll_array[fd].fd) == -1) - ACE_OS::perror ("close"); - poll_array[fd].fd = -1; - - if (fd + 1 == width) - { - while (poll_array[fd].fd == -1) - fd--; - width = fd + 1; - } - } - else - { - ::printf ("%*s\n", n, buf); - fflush (stdout); - } - } - - if (poll_array[0].revents & POLLIN) - { - int arg; - int n_handle; - ACE_SPIPE_Addr client; - - if (peer_acceptor.accept (new_stream) == -1) - ACE_OS::perror ("local_accept"); - - n_handle = new_stream.get_handle (); - - if (new_stream.get_remote_addr (client) == -1) - ACE_OS::perror ("get_remote_addr"); - - ACE_OS::printf ("n_handle = %d, uid = %d, gid = %d\n", - n_handle, client.user_id (), client.group_id ()); - - arg = RMSGN | RPROTDAT; - - if (ACE_OS::ioctl (n_handle, I_SRDOPT, (void *) arg) == -1) - ACE_OS::perror ("I_RRDOPT"); - - poll_array[n_handle].fd = n_handle; - if (n_handle >= width) - width = n_handle + 1; - } - } - - return 0; -} -#else -#include <stdio.h> -int main (void) -{ - ACE_OS::fprintf (stderr, "This feature is not supported\n"); - return 0; -} -#endif /* ACE_HAS_STREAM_PIPES */ diff --git a/examples/IPC_SAP/SPIPE_SAP/shared.h b/examples/IPC_SAP/SPIPE_SAP/shared.h deleted file mode 100644 index 3f7d7647023..00000000000 --- a/examples/IPC_SAP/SPIPE_SAP/shared.h +++ /dev/null @@ -1,6 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "ace/OS.h" - -static const char *rendezvous = ACE_DEFAULT_RENDEZVOUS; |