summaryrefslogtreecommitdiff
path: root/examples/Connection/blocking
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Connection/blocking')
-rw-r--r--examples/Connection/blocking/Makefile328
-rw-r--r--examples/Connection/blocking/README36
-rw-r--r--examples/Connection/blocking/SPIPE-acceptor.cpp183
-rw-r--r--examples/Connection/blocking/SPIPE-acceptor.h63
-rw-r--r--examples/Connection/blocking/SPIPE-connector.cpp198
-rw-r--r--examples/Connection/blocking/SPIPE-connector.h75
-rw-r--r--examples/Connection/blocking/test_spipe_acceptor.cpp20
-rw-r--r--examples/Connection/blocking/test_spipe_connector.cpp20
8 files changed, 0 insertions, 923 deletions
diff --git a/examples/Connection/blocking/Makefile b/examples/Connection/blocking/Makefile
deleted file mode 100644
index f2a5a9ad1ec..00000000000
--- a/examples/Connection/blocking/Makefile
+++ /dev/null
@@ -1,328 +0,0 @@
-#----------------------------------------------------------------------------
-# @(#)Makefile 1.1 10/18/96
-#
-# Makefile for the Connection pattern tests
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-LIB = libSPIPE.a
-SHLIB = libSPIPE.so
-
-BIN = test_spipe_connector \
- test_spipe_acceptor
-
-SRC = $(addsuffix .cpp,$(BIN))
-OBJ = $(SRC:%.cpp=$(VDIR)%.o)
-
-LSRC = SPIPE-connector.cpp \
- SPIPE-acceptor.cpp
-
-LDLIBS = -lSPIPE
-LIBS = -lACE
-
-VLDLIBS = $(LDLIBS:%=%$(VAR))
-
-BUILD = $(VLIB) $(VSHLIB) $(SHLIBA) $(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.lib.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-LDFLAGS += -L./
-
-#----------------------------------------------------------------------------
-# Dependencies
-#----------------------------------------------------------------------------
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-.obj/SPIPE-connector.o .shobj/SPIPE-connector.so: SPIPE-connector.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/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 \
- $(WRAPPER_ROOT)/ace/Get_Opt.h \
- SPIPE-connector.h \
- $(WRAPPER_ROOT)/ace/Svc_Handler.h \
- $(WRAPPER_ROOT)/ace/Synch_Options.h \
- $(WRAPPER_ROOT)/ace/Task.h \
- $(WRAPPER_ROOT)/ace/Service_Object.h \
- $(WRAPPER_ROOT)/ace/Shared_Object.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Thread_Manager.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Task_T.h \
- $(WRAPPER_ROOT)/ace/Message_Queue.h \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h \
- $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \
- $(WRAPPER_ROOT)/ace/Strategies.h \
- $(WRAPPER_ROOT)/ace/Strategies_T.h \
- $(WRAPPER_ROOT)/ace/Service_Config.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Proactor.h \
- $(WRAPPER_ROOT)/ace/ReactorEx.h \
- $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \
- $(WRAPPER_ROOT)/ace/Connector.h \
- $(WRAPPER_ROOT)/ace/Map_Manager.h \
- $(WRAPPER_ROOT)/ace/Connector.i
-.obj/SPIPE-acceptor.o .shobj/SPIPE-acceptor.so: SPIPE-acceptor.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/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 \
- $(WRAPPER_ROOT)/ace/Get_Opt.h \
- SPIPE-acceptor.h \
- $(WRAPPER_ROOT)/ace/Svc_Handler.h \
- $(WRAPPER_ROOT)/ace/Synch_Options.h \
- $(WRAPPER_ROOT)/ace/Task.h \
- $(WRAPPER_ROOT)/ace/Service_Object.h \
- $(WRAPPER_ROOT)/ace/Shared_Object.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Thread_Manager.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Task_T.h \
- $(WRAPPER_ROOT)/ace/Message_Queue.h \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h \
- $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \
- $(WRAPPER_ROOT)/ace/Strategies.h \
- $(WRAPPER_ROOT)/ace/Strategies_T.h \
- $(WRAPPER_ROOT)/ace/Service_Config.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Proactor.h \
- $(WRAPPER_ROOT)/ace/ReactorEx.h \
- $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \
- $(WRAPPER_ROOT)/ace/Acceptor.h \
- $(WRAPPER_ROOT)/ace/Acceptor.i
-.obj/test_spipe_connector.o .shobj/test_spipe_connector.so: test_spipe_connector.cpp SPIPE-connector.h \
- $(WRAPPER_ROOT)/ace/Svc_Handler.h \
- $(WRAPPER_ROOT)/ace/Synch_Options.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.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/Task.h \
- $(WRAPPER_ROOT)/ace/Service_Object.h \
- $(WRAPPER_ROOT)/ace/Shared_Object.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Thread_Manager.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Task_T.h \
- $(WRAPPER_ROOT)/ace/Message_Queue.h \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h \
- $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \
- $(WRAPPER_ROOT)/ace/Strategies.h \
- $(WRAPPER_ROOT)/ace/Strategies_T.h \
- $(WRAPPER_ROOT)/ace/Service_Config.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/Addr.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.i \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Proactor.h \
- $(WRAPPER_ROOT)/ace/ReactorEx.h \
- $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \
- $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \
- $(WRAPPER_ROOT)/ace/SPIPE.h \
- $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \
- $(WRAPPER_ROOT)/ace/SPIPE.i \
- $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \
- $(WRAPPER_ROOT)/ace/Connector.h \
- $(WRAPPER_ROOT)/ace/Map_Manager.h \
- $(WRAPPER_ROOT)/ace/Connector.i \
- $(WRAPPER_ROOT)/ace/SPIPE_Connector.h \
- $(WRAPPER_ROOT)/ace/SPIPE_Connector.i
-.obj/test_spipe_acceptor.o .shobj/test_spipe_acceptor.so: test_spipe_acceptor.cpp SPIPE-acceptor.h \
- $(WRAPPER_ROOT)/ace/Svc_Handler.h \
- $(WRAPPER_ROOT)/ace/Synch_Options.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.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/Task.h \
- $(WRAPPER_ROOT)/ace/Service_Object.h \
- $(WRAPPER_ROOT)/ace/Shared_Object.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Thread_Manager.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Task_T.h \
- $(WRAPPER_ROOT)/ace/Message_Queue.h \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h \
- $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \
- $(WRAPPER_ROOT)/ace/Strategies.h \
- $(WRAPPER_ROOT)/ace/Strategies_T.h \
- $(WRAPPER_ROOT)/ace/Service_Config.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/Addr.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.i \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Proactor.h \
- $(WRAPPER_ROOT)/ace/ReactorEx.h \
- $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \
- $(WRAPPER_ROOT)/ace/Acceptor.h \
- $(WRAPPER_ROOT)/ace/Acceptor.i \
- $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \
- $(WRAPPER_ROOT)/ace/SPIPE.h \
- $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \
- $(WRAPPER_ROOT)/ace/SPIPE.i \
- $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \
- $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/examples/Connection/blocking/README b/examples/Connection/blocking/README
deleted file mode 100644
index c7763e3ed04..00000000000
--- a/examples/Connection/blocking/README
+++ /dev/null
@@ -1,36 +0,0 @@
-Presently, this directory contains only one example application for
-SPIPEs. The test source code is contained in SPIPE-acceptor.h and
-SPIPE-connector.h.
-
-The SPIPE-acceptor example illustrates how named pipes are used on NT.
-Once the server establishes a connection to a single client, it spawns
-a thread pool to handle incoming requests via the proactor event loop.
-That is, a separate thread from the pool is used to process each
-message sent by a client. The size of the thread pool can be
-specified by command-line arguments. This example leverages the
-queueing performed by the NT kernel to trivially implement a thread
-pool architecture.
-
-test_spipe_acceptor has the following command-line arguments:
-
-test_spipe_acceptor -t <threads>
-
-<threads> specifies the size of the thread-pool running in the
-proactor event loop.
-
-Here's how to run the tests:
-
-% test_spipe_acceptor -t 1000000
-starting up daemon test_sock_acceptor
-Opening acepipe
-hello
-
-% test_spipe_connector
-starting up daemon test_sock_connector
-Opening acepipe
-activating 5
-
-please enter input..: hello
-
-There are a number of other options that you can provide. Please see
-the source code for details.
diff --git a/examples/Connection/blocking/SPIPE-acceptor.cpp b/examples/Connection/blocking/SPIPE-acceptor.cpp
deleted file mode 100644
index f8ee2e1dc22..00000000000
--- a/examples/Connection/blocking/SPIPE-acceptor.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-// $Id$
-
-#if !defined (SPIPE_ACCEPTOR_C)
-#define SPIPE_ACCEPTOR_C
-
-#include "ace/SPIPE_Addr.h"
-#include "ace/SPIPE_Acceptor.h"
-#include "ace/Get_Opt.h"
-#include "SPIPE-acceptor.h"
-
-Svc_Handler::Svc_Handler (void)
-{
-}
-
-Svc_Handler::~Svc_Handler (void)
-{
-}
-
-int
-Svc_Handler::open (void *)
-{
- ACE_DEBUG ((LM_DEBUG, "client connected on handle %d\n",
- this->peer ().get_handle ()));
- return ACE_Service_Config::proactor ()->initiate
- (this, ACE_Event_Handler::READ_MASK);
-}
-
-ACE_Message_Block *
-Svc_Handler::get_message (void)
-{
- // An extra byte for null termination.
- ACE_Message_Block *message =
- new ACE_Message_Block (BUFSIZ + 1);
- message->size (BUFSIZ);
- return message;
-}
-
-int
-Svc_Handler::handle_input_complete (ACE_Message_Block *msg,
- long bytes_transfered)
-{
- if (bytes_transfered > 0)
- {
- msg->base ()[msg->length ()] = '\0';
- // Print out the message received from the server.
- ACE_DEBUG ((LM_DEBUG, "(%t) message size %d.\n", msg->length ()));
- ACE_DEBUG ((LM_DEBUG, "%s", msg->rd_ptr ()));
-
- return 1; // Reinvoke a recv() operation.
- }
- else
- return -1; // Close down.
-}
-
-IPC_Server::IPC_Server (void)
- : n_threads_ (1),
- rendezvous_ ("acepipe"),
- done_handler_ (ACE_Sig_Handler_Ex (ACE_Service_Config::end_proactor_event_loop))
-{
-}
-
-IPC_Server::~IPC_Server (void)
-{
-}
-
-int
-IPC_Server::init (int argc, char *argv[])
-{
- if (this->parse_args (argc, argv) == -1)
- return -1;
-
- ACE_DEBUG ((LM_DEBUG, "Opening %s\n", rendezvous_));
-
- // Initialize named pipe listener.
- if (this->open (ACE_SPIPE_Addr (rendezvous_)) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1);
-
- // Register to receive shutdowns.
- else if (ACE_Service_Config::reactor ()->register_handler
- (SIGINT, &this->done_handler_) == -1)
- return -1;
- else
- return 0;
-}
-
-int
-IPC_Server::fini (void)
-{
- return 0;
-}
-
-int
-IPC_Server::parse_args (int argc, char *argv[])
-{
- ACE_LOG_MSG->open (argv[0]);
-
- ACE_Get_Opt get_opt (argc, argv, "ut:r:");
-
- for (int c; (c = get_opt ()) != -1; )
- {
- switch (c)
- {
- case 'r':
- rendezvous_ = get_opt.optarg;
- break;
- case 't':
- n_threads_ = ACE_OS::atoi (get_opt.optarg);
- ACE_DEBUG ((LM_DEBUG, "%s == %d.\n",
- get_opt.optarg,
- n_threads_));
- ACE_Service_Config::proactor (2*n_threads_);
- // This is a lame way to tell the proactor how many threads
- // we'll be using.
- break;
- case 'u':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %n -t <threads>\n"
- "-r <rendezvous>\n"), -1);
- break;
- }
- }
-
- return 0;
-}
-
-static void *
-run_reactor_event_loop (void *)
-{
- ACE_Thread_Control tc (ACE_Service_Config::thr_mgr ());
- ACE_DEBUG ((LM_DEBUG, "(%t) worker thread starting\n"));
-
- ACE_Service_Config::run_proactor_event_loop ();
- return 0;
-}
-
-int
-IPC_Server::svc (void)
-{
- // Performs the iterative server activities.
- while (ACE_Service_Config::reactor_event_loop_done () == 0)
- {
- Svc_Handler sh;
-
- // Create a new SH endpoint, which performs all processing in
- // its open() method (note no automatic restart if errno ==
- // EINTR).
- if (this->accept (&sh, 0) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "accept"), 1);
- // SH's destructor closes the stream implicitly but the
- // listening endpoint stays open.
- else
- {
- // Run single-threaded.
- if (n_threads_ <= 1)
- run_reactor_event_loop (0);
- else
- {
- // Run thread pool.
- if (ACE_Service_Config::thr_mgr ()->spawn_n (n_threads_,
- run_reactor_event_loop,
- 0, THR_NEW_LWP)
- == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn_n"), 1);
-
- ACE_Service_Config::thr_mgr ()->wait ();
- }
-
- ACE_DEBUG ((LM_DEBUG, "(%t) main thread exiting.\n"));
- }
- }
-
- /* NOTREACHED */
- return 0;
-}
-
-#endif /* SPIPE_ACCEPTOR_C */
-
-
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_Concurrency_Strategy<Svc_Handler>;
-template class ACE_Oneshot_Acceptor<Svc_Handler, ACE_SPIPE_ACCEPTOR>;
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
diff --git a/examples/Connection/blocking/SPIPE-acceptor.h b/examples/Connection/blocking/SPIPE-acceptor.h
deleted file mode 100644
index aee2d645ca5..00000000000
--- a/examples/Connection/blocking/SPIPE-acceptor.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-#if !defined (SP_ACCEPTOR_H)
-#define SP_ACCEPTOR_H
-
-#include "ace/Svc_Handler.h"
-#include "ace/Acceptor.h"
-#include "ace/SPIPE_Stream.h"
-#include "ace/SPIPE_Acceptor.h"
-
-// This is the class that does the work once the ACE_Oneshot_Acceptor
-// has accepted a connection.
-
-class Svc_Handler : public ACE_Svc_Handler <ACE_SPIPE_STREAM, ACE_NULL_SYNCH>
-{
-public:
- Svc_Handler (void);
- ~Svc_Handler (void);
-
- virtual int open (void *);
-
- virtual ACE_Message_Block *get_message (void);
-
- virtual int handle_input_complete (ACE_Message_Block *msg,
- long bytes_transfered);
- // Handle data from the client.
-
-private:
-};
-
-class IPC_Server : public ACE_Oneshot_Acceptor<Svc_Handler, ACE_SPIPE_ACCEPTOR>
-{
-public:
- IPC_Server (void);
- ~IPC_Server (void);
-
- // = Dynamic linking hooks.
- virtual int init (int argc, char *argv[]);
- // Initialize the network server.
-
- virtual int fini (void);
- // Close down the server.
-
- virtual int svc (void);
- // Run the interative service.
-
-private:
- int parse_args (int argc, char *argv[]);
- // Parse command-line arguments.
-
- int n_threads_;
- // Size of thread pool to use.
-
- const char *rendezvous_;
- // Meeting place for pipe.
-
- ACE_Sig_Adapter done_handler_;
- // Keeps track of when we shut down due to receipt of the SIGINT
- // signal.
-};
-
-#endif /* SP_ACCEPTOR_H */
diff --git a/examples/Connection/blocking/SPIPE-connector.cpp b/examples/Connection/blocking/SPIPE-connector.cpp
deleted file mode 100644
index 9a631de8e58..00000000000
--- a/examples/Connection/blocking/SPIPE-connector.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-#if !defined (SPIPE_CONNECTOR_C)
-// $Id$
-
-#define SPIPE_CONNECTOR_C
-
-
-#include "ace/SPIPE_Addr.h"
-#include "ace/SPIPE_Connector.h"
-#include "ace/Get_Opt.h"
-#include "SPIPE-connector.h"
-
-Peer_Handler::Peer_Handler (int iterations)
- : iterations_ (iterations)
-{
-}
-
-Peer_Handler::~Peer_Handler ()
-{
-}
-
-int
-Peer_Handler::open (void *)
-{
- ACE_DEBUG ((LM_DEBUG, "activating %d\n", this->get_handle ()));
-
- // If iterations_ has not been set, read from stdin.
- if (iterations_ == 0)
- {
- this->display_menu ();
- if (ACE::register_stdin_handler (this,
- ACE_Service_Config::reactor (),
- ACE_Service_Config::thr_mgr ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_stdin_handler"), -1);
- }
- else // If iterations_ has been set, send iterations_ buffers.
- {
- char *buffer =
- "Oh give me a home\n"
- "Where the buffalo roam,\n"
- "And the deer and the antelope play.\n"
- "Where seldom is heard\n"
- "A discouraging word,\n"
- "And the skies are not cloudy all day.\n";
- int length = ACE_OS::strlen (buffer);
-
- while (iterations_-- > 0
- && this->peer ().send_n (buffer, length) == length)
- continue;
- }
- return this->peer ().close ();
-}
-
-int
-Peer_Handler::handle_input (ACE_HANDLE)
-{
- char buf[BUFSIZ];
-
- ssize_t n = ACE_OS::read (ACE_STDIN, buf, sizeof buf);
-
- if (n > 0)
- if (this->peer ().send (buf, n) != n)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "write failed"), -1);
- else if (n == 0) /* Explicitly close the connection. */
- {
- if (this->peer ().close () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1);
- return -1;
- }
- else
- this->display_menu ();
- return 0;
-}
-
-int
-Peer_Handler::handle_close (ACE_HANDLE,
- ACE_Reactor_Mask)
-{
- ACE_DEBUG ((LM_DEBUG, "Shutting down\n"));
- return 0;
-}
-
-ACE_HANDLE
-Peer_Handler::get_handle (void) const
-{
- return this->peer ().get_handle ();
-}
-
-void
-Peer_Handler::display_menu (void)
-{
- ACE_DEBUG ((LM_DEBUG, "\nplease enter input..: "));
-}
-
-IPC_Client::IPC_Client (void)
- : iterations_ (0),
- rendezvous_ ("acepipe"),
- done_handler_ (ACE_Sig_Handler_Ex (ACE_Service_Config::end_proactor_event_loop))
-{
-}
-
-IPC_Client::~IPC_Client (void)
-{
-}
-
-// Dynamic linking hooks.
-
-int
-IPC_Client::init (int argc, char *argv[])
-{
- if (this->parse_args (argc, argv) == -1)
- return -1;
- // Handle signals through the ACE_Reactor.
- else if (ACE_Service_Config::reactor ()->register_handler
- (SIGINT, &this->done_handler_) == -1)
- return -1;
-
- ACE_DEBUG ((LM_DEBUG, "Opening %s\n", rendezvous_));
-
- // Connect to the peer, reusing the local addr if necessary.
- if (this->connect (new Peer_Handler (iterations_),
- ACE_SPIPE_Addr (rendezvous_),
- ACE_Synch_Options::defaults,
- *((ACE_SPIPE_Addr *) &ACE_Addr::sap_any),
- 0,
- O_RDWR | FILE_FLAG_OVERLAPPED,
- 0) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connect"), -1);
-
- return 0;
-}
-
-int
-IPC_Client::fini (void)
-{
- return 0;
-}
-
-int
-IPC_Client::svc (void)
-{
- ACE_Service_Config::run_reactor_event_loop ();
- return 0;
-}
-
-int
-IPC_Client::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
-{
- return 0;
-}
-
-int
-IPC_Client::parse_args (int argc, char *argv[])
-{
- ACE_LOG_MSG->open (argv[0]);
-
- ACE_Get_Opt get_opt (argc, argv, "ui:r:");
-
- for (int c; (c = get_opt ()) != -1; )
- {
- switch (c)
- {
- case 'r':
- rendezvous_ = get_opt.optarg;
- break;
- case 'i':
- iterations_ = ACE_OS::atoi (get_opt.optarg);
- break;
- case 'u':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %n -i <iterations>\n"
- "-r <rendezvous>\n"), -1);
- break;
- }
- }
-
- return 0;
-}
-
-
-#endif /* SPIPE_CONNECTOR */
-
-
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_Connector<Peer_Handler, ACE_SPIPE_CONNECTOR>;
-template class ACE_Guard<ACE_RW_Mutex>;
-template class ACE_Map_Iterator<int, ACE_Svc_Tuple<Peer_Handler> *, ACE_RW_Mutex>;
-template class ACE_Map_Manager<int, ACE_Svc_Tuple<Peer_Handler> *, ACE_RW_Mutex>;
-template class ACE_Message_Queue<ACE_NULL_SYNCH>;
-template class ACE_Module<ACE_NULL_SYNCH>;
-template class ACE_Read_Guard<ACE_RW_Mutex>;
-template class ACE_Svc_Handler<ACE_SPIPE_STREAM, ACE_NULL_SYNCH>;
-template class ACE_Svc_Tuple<Peer_Handler>;
-template class ACE_TSS<ACE_Dynamic>;
-template class ACE_Task<ACE_NULL_SYNCH>;
-template class ACE_Thru_Task<ACE_NULL_SYNCH>;
-template class ACE_Write_Guard<ACE_RW_Mutex>;
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
diff --git a/examples/Connection/blocking/SPIPE-connector.h b/examples/Connection/blocking/SPIPE-connector.h
deleted file mode 100644
index 8dd26a32e20..00000000000
--- a/examples/Connection/blocking/SPIPE-connector.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-#if !defined (SP_CONNECTOR_H)
-#define SP_CONNECTOR_H
-
-#include "ace/Svc_Handler.h"
-#include "ace/SPIPE_Stream.h"
-#include "ace/Connector.h"
-#include "ace/SPIPE_Connector.h"
-
-class Peer_Handler : public ACE_Svc_Handler<ACE_SPIPE_STREAM, ACE_NULL_SYNCH>
-{
-public:
- // = Initialization
-
- Peer_Handler (int iterations);
- // <iterations> is the number of buffers to send. If <iterations>
- // == 0, then read from stdin.
-
- ~Peer_Handler (void);
-
- virtual int open (void * = 0);
- // Activate the handler when connection is established.
-
- // = Demultiplexing hooks.
- virtual int handle_input (ACE_HANDLE);
- virtual int handle_close (ACE_HANDLE handle = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask mask = ACE_Event_Handler::ALL_EVENTS_MASK);
-
- virtual ACE_HANDLE get_handle (void) const;
-
-private:
- void display_menu (void);
-
- int iterations_;
- // No. of buffers to send.
-};
-
-class IPC_Client : public ACE_Connector<Peer_Handler, ACE_SPIPE_CONNECTOR>
-{
-public:
- // Initialization
- IPC_Client (void);
- ~IPC_Client (void);
-
- // = Dynamic linking hooks.
- virtual int init (int argc, char *argv[]);
- // Initialize the IPC client.
-
- virtual int fini (void);
- // Destroy the IPC client.
-
- virtual int svc (void);
- // Run the svc.
-
- virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
- // Report connection errors.
-
-private:
- int parse_args (int argc, char *argv[]);
- // Parse command-line arguments.
-
- int iterations_;
- // Number of times to send a buffer.
-
- const char *rendezvous_;
- // Meeting place for pipe.
-
- ACE_Sig_Adapter done_handler_;
- // Keeps track of when we shut down due to receipt of the SIGINT
- // signal.
-};
-
-#endif /* SP_CONNECTOR_H */
diff --git a/examples/Connection/blocking/test_spipe_acceptor.cpp b/examples/Connection/blocking/test_spipe_acceptor.cpp
deleted file mode 100644
index 3be8810c22e..00000000000
--- a/examples/Connection/blocking/test_spipe_acceptor.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// $Id$
-
-// ACE_SPIPE Server.
-
-#include "SPIPE-acceptor.h"
-
-int
-main (int argc, char *argv[])
-{
- // Perform Service_Config initializations
- ACE_Service_Config daemon (argv[0]);
-
- IPC_Server peer_acceptor;
-
- if (peer_acceptor.init (argc, argv) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init"), -1);
-
- return peer_acceptor.svc ();
-}
-
diff --git a/examples/Connection/blocking/test_spipe_connector.cpp b/examples/Connection/blocking/test_spipe_connector.cpp
deleted file mode 100644
index 2ebeaaecd06..00000000000
--- a/examples/Connection/blocking/test_spipe_connector.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// $Id$
-
-// ACE_SPIPE Client.
-
-#include "SPIPE-connector.h"
-
-int
-main (int argc, char *argv[])
-{
- // Perform Service_Config initializations
- ACE_Service_Config daemon (argv[0]);
-
- IPC_Client peer_connector;
-
- if (peer_connector.init (argc, argv) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init"), -1);
-
- return peer_connector.svc ();
-}
-