diff options
Diffstat (limited to 'examples/Connection/misc')
-rw-r--r-- | examples/Connection/misc/Connection_Handler.cpp | 238 | ||||
-rw-r--r-- | examples/Connection/misc/Makefile | 180 | ||||
-rw-r--r-- | examples/Connection/misc/test_upipe.cpp | 200 |
3 files changed, 0 insertions, 618 deletions
diff --git a/examples/Connection/misc/Connection_Handler.cpp b/examples/Connection/misc/Connection_Handler.cpp deleted file mode 100644 index c3505184fc3..00000000000 --- a/examples/Connection/misc/Connection_Handler.cpp +++ /dev/null @@ -1,238 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = FILENAME -// Connection_Handler.cpp -// -// = DESCRIPTION -// This test illustrates how to use the Acceptor pattern to -// create multiple threads, each running its own Reactor. You -// can connect to this via telnet and keep typing until you enter -// '^D'. -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ - -#include "ace/Acceptor.h" -#include "ace/SOCK_Acceptor.h" -#include "ace/Service_Config.h" -#include "ace/Thread.h" - -class Connection_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -{ -public: - virtual int open (void *); - // Initialize the <Connection_Handler> and make it an Active Object. - - virtual int close (u_long); - // Terminate the <Connection_Handler>. - - virtual int svc (void); - // Run the <Connection_Handler>'s main event loop. - -protected: - virtual int handle_close (ACE_HANDLE, - ACE_Reactor_Mask); - // Signal the Active Object to stop when called. - - virtual int handle_input (ACE_HANDLE); - // Handle input from the client. - - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - // Handle timeouts. - - virtual int handle_signal (int signum, - siginfo_t *, - ucontext_t *); - // Handle timeouts. - - sig_atomic_t finished_; - // Keeps track of whether we're done. -}; - -int -Connection_Handler::open (void *) -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) in open()\n")); - - // Create an Active Object. - return this->activate (THR_NEW_LWP); -} - -int -Connection_Handler::close (u_long) -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) in close()\n")); - - // Shut ourself down. - this->destroy (); - return 0; -} - -int -Connection_Handler::svc (void) -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) in svc()\n")); - - this->finished_ = 0; - - // Create our own personal Reactor just for this thread. Note that - // we create this on the stack of the thread since it's only used - // for the duration of this connection! - - ACE_Reactor reactor; - - // Each <ACE_Svc_Handler> has its own <ACE_Reactor *>. By default, this - // points to the <Acceptor's> Reactor. However, we can point it to our - // local Reactor, which is what we do in this case. - this->reactor (&reactor); - - // Register ourselves to handle input in this thread without - // blocking. - if (this->reactor ()->register_handler - (this, ACE_Event_Handler::READ_MASK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "can' (%P|%t) t register with reactor\n"), -1); - - // Schedule a timer. - else if (this->reactor ()->schedule_timer - (this, - (const void *) this, - ACE_Time_Value (2), - ACE_Time_Value (2)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) can't register with reactor\n"), -1); - else - ACE_DEBUG ((LM_DEBUG, " (%P|%t) connected with client\n")); - - // Keep looping until we receive SIGQUIT or the client shutsdown. - - while (this->finished_ == 0) - { - ACE_DEBUG ((LM_DEBUG, " (%P|%t) handling events\n")); - this->reactor ()->handle_events (); - } - - // Cancel all pending timeouts. - ACE_Service_Config::reactor ()->cancel_timer (this); - - // Remove ourselves from the Reactor. - this->reactor ()->remove_handler - (this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL); - - // Zero-out the Reactor field so it isn't accessed later on. - this->reactor (0); - - ACE_DEBUG ((LM_DEBUG, " (%P|%t) exiting svc\n")); - return 0; -} - -int -Connection_Handler::handle_close (ACE_HANDLE, - ACE_Reactor_Mask) -{ - ACE_DEBUG ((LM_DEBUG, " (%P|%t) in handle_close \n")); - - // Signal the svc() event loop to shut down. - this->finished_ = 1; - return 0; -} - -int -Connection_Handler::handle_input (ACE_HANDLE) -{ - char buf[BUFSIZ]; - - ACE_DEBUG ((LM_DEBUG, " (%P|%t) handle_input\n")); - - switch (this->peer ().recv (buf, sizeof buf)) - { - case -1: - ACE_ERROR_RETURN ((LM_ERROR, " (%P|%t) %p bad read\n", "client logger"), -1); - case 0: - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) closing log daemon (fd = %d)\n", this->get_handle ()), -1); - default: - if (buf[0] == EOF) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) closing log daemon (fd = %d)\n", this->get_handle ()), -1); - else - ACE_DEBUG ((LM_DEBUG, " (%P|%t) from client: %s", buf)); - } - - return 0; -} - -int -Connection_Handler::handle_signal (int signum, - siginfo_t *, - ucontext_t *) -{ - ACE_DEBUG ((LM_DEBUG, "received signal %S\n", signum)); - this->finished_ = 1; - return 0; -} - -int -Connection_Handler::handle_timeout (const ACE_Time_Value &tv, - const void *arg) -{ - ACE_UNUSED_ARG (tv); - - ACE_ASSERT (arg == this); - ACE_DEBUG ((LM_DEBUG, " (%P|%t) handling timeout from this = %u\n", this)); - return 0; -} - -// Define an Acceptor for the <Connection_Handler>. - -typedef ACE_Acceptor <Connection_Handler, ACE_SOCK_ACCEPTOR> - Connection_Acceptor; - -int -main (int argc, char *argv[]) -{ - ACE_Service_Config daemon (argv[0]); - - u_short port = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - - ACE_DEBUG ((LM_DEBUG, " (%P|%t) in main\n")); - - // Acceptor factory. - Connection_Acceptor peer_acceptor; - - // Create an adapter to end the event loop. - ACE_Sig_Adapter sa ((ACE_Sig_Handler_Ex) ACE_Service_Config::end_reactor_event_loop); - - // Register the signal handler adapter. - if (daemon.reactor ()->register_handler (SIGINT, &sa) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1); - - // Open the Acceptor. - else if (peer_acceptor.open (ACE_INET_Addr (port), - daemon.reactor ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1); - - ACE_DEBUG ((LM_DEBUG, " (%P|%t) starting up connection server\n")); - - // Perform connection service until we receive SIGINT. - - while (daemon.reactor_event_loop_done () == 0) - daemon.run_reactor_event_loop (); - - ACE_DEBUG ((LM_DEBUG, " (%P|%t) shutting down connection server\n")); - - return 0; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) -template class ACE_Acceptor<Connection_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Message_Queue<ACE_NULL_SYNCH>; -template class ACE_Module<ACE_NULL_SYNCH>; -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_TSS<ACE_Dynamic>; -template class ACE_Task<ACE_NULL_SYNCH>; -template class ACE_Thru_Task<ACE_NULL_SYNCH>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ diff --git a/examples/Connection/misc/Makefile b/examples/Connection/misc/Makefile deleted file mode 100644 index 1c7a6df6c2b..00000000000 --- a/examples/Connection/misc/Makefile +++ /dev/null @@ -1,180 +0,0 @@ -#---------------------------------------------------------------------------- -# @(#)Makefile 1.1 10/18/96 -# -# Makefile for a test of the miscellaneous UPIPE examples -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = test_upipe \ - Connection_Handler - -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/test_upipe.o .shobj/test_upipe.so: test_upipe.cpp \ - $(WRAPPER_ROOT)/ace/Acceptor.h \ - $(WRAPPER_ROOT)/ace/Service_Config.h \ - $(WRAPPER_ROOT)/ace/Service_Object.h \ - $(WRAPPER_ROOT)/ace/Shared_Object.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/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/Signal.h \ - $(WRAPPER_ROOT)/ace/Set.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/Message_Block.h \ - $(WRAPPER_ROOT)/ace/Malloc.h \ - $(WRAPPER_ROOT)/ace/Malloc_T.h \ - $(WRAPPER_ROOT)/ace/Memory_Pool.h \ - $(WRAPPER_ROOT)/ace/Mem_Map.h \ - $(WRAPPER_ROOT)/ace/ReactorEx.h \ - $(WRAPPER_ROOT)/ace/Message_Queue.h \ - $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ - $(WRAPPER_ROOT)/ace/Strategies.h \ - $(WRAPPER_ROOT)/ace/Strategies_T.h \ - $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \ - $(WRAPPER_ROOT)/ace/Svc_Handler.h \ - $(WRAPPER_ROOT)/ace/Synch_Options.h \ - $(WRAPPER_ROOT)/ace/Task.h \ - $(WRAPPER_ROOT)/ace/Task_T.h \ - $(WRAPPER_ROOT)/ace/Acceptor.i \ - $(WRAPPER_ROOT)/ace/Connector.h \ - $(WRAPPER_ROOT)/ace/Map_Manager.h \ - $(WRAPPER_ROOT)/ace/Connector.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/Stream.h \ - $(WRAPPER_ROOT)/ace/Module.h \ - $(WRAPPER_ROOT)/ace/SPIPE.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Addr.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Acceptor.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.h \ - $(WRAPPER_ROOT)/ace/SPIPE_Stream.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Acceptor.i \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.h \ - $(WRAPPER_ROOT)/ace/UPIPE_Connector.i -.obj/Connection_Handler.o .shobj/Connection_Handler.so: Connection_Handler.cpp \ - $(WRAPPER_ROOT)/ace/Acceptor.h \ - $(WRAPPER_ROOT)/ace/Service_Config.h \ - $(WRAPPER_ROOT)/ace/Service_Object.h \ - $(WRAPPER_ROOT)/ace/Shared_Object.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/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/Signal.h \ - $(WRAPPER_ROOT)/ace/Set.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/Message_Block.h \ - $(WRAPPER_ROOT)/ace/Malloc.h \ - $(WRAPPER_ROOT)/ace/Malloc_T.h \ - $(WRAPPER_ROOT)/ace/Memory_Pool.h \ - $(WRAPPER_ROOT)/ace/Mem_Map.h \ - $(WRAPPER_ROOT)/ace/ReactorEx.h \ - $(WRAPPER_ROOT)/ace/Message_Queue.h \ - $(WRAPPER_ROOT)/ace/IO_Cntl_Msg.h \ - $(WRAPPER_ROOT)/ace/Strategies.h \ - $(WRAPPER_ROOT)/ace/Strategies_T.h \ - $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \ - $(WRAPPER_ROOT)/ace/Svc_Handler.h \ - $(WRAPPER_ROOT)/ace/Synch_Options.h \ - $(WRAPPER_ROOT)/ace/Task.h \ - $(WRAPPER_ROOT)/ace/Task_T.h \ - $(WRAPPER_ROOT)/ace/Acceptor.i \ - $(WRAPPER_ROOT)/ace/SOCK_Acceptor.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/examples/Connection/misc/test_upipe.cpp b/examples/Connection/misc/test_upipe.cpp deleted file mode 100644 index c4214c92df3..00000000000 --- a/examples/Connection/misc/test_upipe.cpp +++ /dev/null @@ -1,200 +0,0 @@ -// This short program illustrates in implementation of the classic -// $Id$ - -// "bounded buffer" program using ACE_UPIPEs. This program also shows -// how the ACE_Connector and ACE_Acceptor patterns work when used with -// ACE_UPIPEs. - -// Enable tracing - -#include "ace/Acceptor.h" -#include "ace/Connector.h" -#include "ace/UPIPE_Acceptor.h" -#include "ace/UPIPE_Connector.h" -#include "ace/UPIPE_Addr.h" - -#if defined (ACE_HAS_THREADS) - -typedef ACE_Svc_Handler <ACE_UPIPE_STREAM, ACE_NULL_SYNCH> SVC_HANDLER; - -class Server_Service : public SVC_HANDLER - // = TITLE - // Defines the interface for a service that recvs data from its - // client and writes the data to its stdout. -{ -public: - Server_Service (ACE_Thread_Manager * = 0) {} - virtual int open (void *) - { - ACE_TRACE ("Server_Service::open"); - return 0; - } - - virtual int svc (void) - { - ACE_TRACE ("Server_Service::svc"); - - char buf[BUFSIZ]; - ssize_t n; - - while ((n = this->peer ().recv (buf, sizeof buf)) > 0) - ::write (1, buf, n); - - return 0; - } -}; - -class Server : public ACE_Strategy_Acceptor <Server_Service, ACE_UPIPE_ACCEPTOR> - // = TITLE - // Defines the interface for a factory that accepts connections - // and creates/activates Server_Service objects. -{ -public: - Server (ACE_Thread_Manager *thr_mgr, - ACE_Reactor *reactor) - : reactor_ (reactor), - thr_mgr_ (thr_mgr) - { - ACE_TRACE ("Server::Server"); - } - - virtual int init (int argc, char *argv[]) - { - ACE_TRACE ("Server::init"); - const char *l_addr = argc > 1 ? argv[1] : ACE_DEFAULT_RENDEZVOUS; - - ACE_UPIPE_Addr local_addr (l_addr); - - if (this->thr_strategy_.open (this->thr_mgr_, THR_DETACHED | THR_NEW_LWP) == -1) - return -1; - else if (this->open (local_addr, this->reactor_, - 0, 0, &this->thr_strategy_) == -1) - return -1; - - // Give server a chance to register the STREAM pipe. - ACE_OS::sleep (ACE_Time_Value (4)); - return 0; - } - -private: - ACE_Reactor *reactor_; - // Our instance of the reactor. - - ACE_Thread_Manager *thr_mgr_; - // Our instance of a thread manager. - - ACE_Thread_Strategy<Server_Service> thr_strategy_; - // Our concurrency strategy. -}; - -class Client_Service : public SVC_HANDLER - // = TITLE - // Defines the interface for a service that recvs data from its - // stdin and forward the data to its server. -{ -public: - Client_Service (ACE_Thread_Manager *thr_mgr) - : SVC_HANDLER (thr_mgr) - { - ACE_TRACE ("Client_Service::Client_Service"); - } - - virtual int open (void *) - { - ACE_TRACE ("Client_Service::open"); - return this->activate (THR_DETACHED | THR_NEW_LWP); - } - - virtual int svc (void) - { - ACE_TRACE ("Client_Service::svc"); - char buf[BUFSIZ]; - ssize_t n; - - while ((n = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0) - this->peer ().send (buf, sizeof buf); - - this->peer ().close (); - return 0; - } -}; - -class Client : public ACE_Connector <Client_Service, ACE_UPIPE_CONNECTOR> - // = TITLE - // Defines the interface for a factory that connects - // a Client_Service with a Server. -{ -public: - Client (ACE_Thread_Manager *thr_mgr) - : thr_mgr_ (thr_mgr) - { - ACE_TRACE ("Client::Client"); - } - - virtual int init (int argc, char *argv[]) - { - ACE_TRACE ("Client::init"); - - char *r_addr = argc > 1 ? argv[1] : ACE_DEFAULT_RENDEZVOUS; - - ACE_UPIPE_Addr remote_addr (r_addr); - - return this->connect (new Client_Service (this->thr_mgr_), remote_addr); - } - -private: - ACE_Thread_Manager *thr_mgr_; -}; - -//---------------------------------------- - -int main (int argc, char *argv[]) -{ - ACE_Service_Config svc_conf; - ACE_Thread_Manager thr_mgr; - - Client peer_connector (&thr_mgr); - Server peer_acceptor (&thr_mgr, ACE_Service_Config::reactor ()); - - // Establish the connection between Acceptor and Connector. - - if (peer_acceptor.init (argc, argv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init"), -1); - else if (peer_connector.init (argc, argv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init"), -1); - - // Wait for threads to exit. - thr_mgr.wait (); - return 0; -} -#else -int -main (void) -{ - ACE_ERROR_RETURN ((LM_ERROR, "your platform does not support threads\n"), 1); -} -#endif /* ACE_HAS_THREADS */ - - -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) -template class ACE_Accept_Strategy<Server_Service, ACE_UPIPE_ACCEPTOR>; -template class ACE_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR>; -template class ACE_Concurrency_Strategy<Server_Service>; -template class ACE_Connector<Client_Service, ACE_UPIPE_CONNECTOR>; -template class ACE_Creation_Strategy<Server_Service>; -template class ACE_Guard<ACE_RW_Mutex>; -template class ACE_Map_Iterator<int, ACE_Svc_Tuple<Client_Service> *, ACE_RW_Mutex>; -template class ACE_Map_Manager<int, ACE_Svc_Tuple<Client_Service> *, 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_Scheduling_Strategy<Server_Service>; -template class ACE_Strategy_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR>; -template class ACE_Svc_Handler<ACE_UPIPE_STREAM, ACE_NULL_SYNCH>; -template class ACE_Svc_Tuple<Client_Service>; -template class ACE_TSS<ACE_Dynamic>; -template class ACE_Task<ACE_NULL_SYNCH>; -template class ACE_Thread_Strategy<Server_Service>; -template class ACE_Thru_Task<ACE_NULL_SYNCH>; -template class ACE_Write_Guard<ACE_RW_Mutex>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ |