diff options
Diffstat (limited to 'apps/Orbix-Examples/Event_Comm/Consumer')
6 files changed, 0 insertions, 654 deletions
diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.cpp b/apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.cpp deleted file mode 100644 index 6b8f6339c5a..00000000000 --- a/apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include "Input_Handler.h" -// $Id$ - -#include "Notification_Receiver_Handler.h" - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) - -Input_Handler::~Input_Handler (void) -{ - ACE_DEBUG ((LM_DEBUG, "closing down Input_Handler::~Input_Handler\n")); - this->handle_close (); -} - -int -Input_Handler::consumer_initiated_shutdown (void) -{ - return this->consumer_initiated_shutdown_; -} - -void -Input_Handler::consumer_initiated_shutdown (int c) -{ - this->consumer_initiated_shutdown_ = c; -} - -ACE_HANDLE -Input_Handler::get_handle (void) const -{ - return this->handle_; -} - -int -Input_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ - ACE_DEBUG ((LM_DEBUG, "closing down Consumer::Input_Handler\n")); - - Event_Comm::Notification_Receiver *receiver = this->receiver_handler_->receiver (); - Event_Comm::Notifier *notifier = this->receiver_handler_->notifier (); - - if (this->consumer_initiated_shutdown ()) - { - // Only try to unsubscribe if the Consumer initiated the - // shutdown. Otherwise, the Supplier initiated it and - // it has probably gone away by now! - TRY { - // Gracefully shutdown the Receiver by removing it - // from the Notifier's internal map. - - notifier->unsubscribe (receiver, "", IT_X); - } CATCHANY { - cerr << IT_X << endl; - } ENDTRY; - } - // Don't execute a callback here otherwise we'll recurse indefinitely! - if (ACE_Reactor::instance ()->remove_handler - (this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "remove_handler")); - - // *Must* be allocated dyanmically! - delete (void *) this; - return 0; -} - -Input_Handler::Input_Handler (Notification_Receiver_Handler *ch, - ACE_HANDLE handle) - : receiver_handler_ (ch), - handle_ (handle), - consumer_initiated_shutdown_ (0) -{ - if (ACE_Reactor::instance ()->register_handler - (this, ACE_Event_Handler::READ_MASK) == -1) - ACE_ERROR ((LM_ERROR, "Input_Handler::Input_Handler\n")); -} - -int -Input_Handler::handle_input (ACE_HANDLE h) -{ - char buf[BUFSIZ]; - ssize_t n; - - // Read up to BUFSIZ worth of data from ACE_HANDLE h. - - n = ACE_OS::read (h, buf, sizeof buf - 1); - - if (n > 0) - { - // Null terminate the buffer, replacing the '\n' with '\0'. - if (buf[n - 1] == '\n' || buf[n - 1] == EOF) - buf[n - 1] = '\0'; - else - buf[n] = '\0'; - ACE_DEBUG ((LM_DEBUG, "notifying for event %s\n", buf)); - - } - else - { - ACE_OS::strcpy (buf, "quit"); - ACE_DEBUG ((LM_DEBUG, "shutting down Input_Handler\n")); - } - - Event_Comm::Notifier *notifier = this->receiver_handler_->notifier (); - - ACE_ASSERT (notifier != 0); - - if (ACE_OS::strcmp (buf, "quit") == 0) - { - // Consumer wants to shutdown. - this->consumer_initiated_shutdown (1); - - // Tell the main event loop to shutdown. - ACE_Reactor::end_event_loop(); - } - else - { - TRY { - Event_Comm::Notification notification; - - notification.tag_ = ACE_OS::strdup (buf); - - notifier->send_notification (notification, IT_X); - } - CATCHANY { - cerr << "Unexpected exception " << IT_X << endl; - } ENDTRY; - } - - /* NOTREACHED */ - return 0; -} -#endif /* ACE_HAS_ORBIX */ diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.h b/apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.h deleted file mode 100644 index a6993ac1a23..00000000000 --- a/apps/Orbix-Examples/Event_Comm/Consumer/Input_Handler.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - - -// ============================================================================ -// -// = LIBRARY -// EventComm -// -// = FILENAME -// Input_Handler.h -// -// = DESCRIPTION -// Subclass of ACE ACE_Service_Object that receives unsubscribes from -// the Notifier when input is received from the keyboard. -// -// = AUTHOR -// Douglas C. Schmidt (schmidt@cs.wustl.edu) -// -// ============================================================================ - -#if !defined (_INPUT_HANDLER_H) -#define _INPUT_HANDLER_ - -#include "ace/Service_Config.h" - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) -// Forward declaration. -class Notification_Receiver_Handler; - -class Input_Handler : public ACE_Service_Object - // = TITLE - // Handles input events generated from a keyboard. - // - // = DESCRIPTION -{ -public: - Input_Handler (Notification_Receiver_Handler *, ACE_HANDLE h = 0); - - virtual int handle_input (ACE_HANDLE); - // Dispatch the callback when events occur. - - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::NULL_MASK); - // Close down the handler. - - int consumer_initiated_shutdown (void); - // Report whether the Consumer initiated the shutdown. - - void consumer_initiated_shutdown (int); - // Indicate that the Consumer initiated the shutdown. - -private: - ~Input_Handler (void); - // Ensure dynamic allocation. - - virtual ACE_HANDLE get_handle (void) const; - - ACE_HANDLE handle_; - // ACE_HANDLE where the input comes from. - - Notification_Receiver_Handler *receiver_handler_; - // Pointer to the <Notification_Receiver_Handler> that - // receives notifications from the <Event_Comm::Notifier>. - - int consumer_initiated_shutdown_; - // Keep track of whether the Consumer initiated the shutdown. -}; - -#endif /* ACE_HAS_ORBIX */ -#endif /* _INPUT_HANDLER_H */ diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/Makefile b/apps/Orbix-Examples/Event_Comm/Consumer/Makefile deleted file mode 100644 index 4e7357d4517..00000000000 --- a/apps/Orbix-Examples/Event_Comm/Consumer/Makefile +++ /dev/null @@ -1,163 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id: Makefile 1.1 10/18/96 -# -# Makefile for the Consumer. -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = consumer - -FILES = Notification_Receiver_Handler \ - Input_Handler - -LSRC = $(addsuffix .cpp,$(FILES)) consumer.cpp -LOBJ = $(addsuffix .o,$(FILES)) -SHOBJ = $(addsuffix .so,$(FILES)) - -LDLIBS = $(addprefix $(VSHDIR),$(LOBJ)) ../libsrc/libEvent_Comm.a -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -CPPFLAGS += -I../include -VLDLIBS += -lgen - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -Notification_Receiver_Handler.o: Notification_Receiver_Handler.cpp \ - Notification_Receiver_Handler.h \ - ${ACE_ROOT}ace/CORBA_Handler.h \ - ${ACE_ROOT}ace/Service_Config.h \ - ${ACE_ROOT}ace/Reactor.h \ - ${ACE_ROOT}ace/Handle_Set.h \ - ${ACE_ROOT}ace/sysincludes.h \ - ${ACE_ROOT}ace/config.h \ - ${ACE_ROOT}ace/Handle_Set.i \ - ${ACE_ROOT}ace/Timer_Queue.h \ - ${ACE_ROOT}ace/Event_Handler.h \ - ${ACE_ROOT}ace/Time_Value.h \ - ${ACE_ROOT}ace/Synch.h \ - ${ACE_ROOT}ace/Synch_T.h \ - ${ACE_ROOT}ace/Timer_Queue.i \ - ${ACE_ROOT}ace/Signal.h \ - ${ACE_ROOT}ace/Set.h \ - ${ACE_ROOT}ace/Thread.h \ - ${ACE_ROOT}ace/Token.h \ - ${ACE_ROOT}ace/Reactor.i \ - ${ACE_ROOT}ace/Log_Msg.h \ - ${ACE_ROOT}ace/Log_Record.h \ - ${ACE_ROOT}ace/Log_Priority.h \ - ${ACE_ROOT}ace/Log_Record.i \ - ${ACE_ROOT}ace/Log_Msg.i \ - ${ACE_ROOT}ace/Thread_Specific.h \ - ${ACE_ROOT}ace/Thread_Specific.i \ - ${ACE_ROOT}ace/Service_Object.h \ - ${ACE_ROOT}ace/Shared_Object.h \ - ${ACE_ROOT}ace/Service_Types.h \ - ${ACE_ROOT}ace/Thread_Manager.h \ - ../include/Event_Comm_i.h ../include/Notification_Receiver_i.h \ - ../include/Notifier_i.h \ - ${ACE_ROOT}ace/Map_Manager.h \ - ${ACE_ROOT}ace/SString.h \ - ${ACE_ROOT}ace/SString.i \ - ../include/Event_Comm.hh -Input_Handler.o: Input_Handler.cpp Input_Handler.h \ - ${ACE_ROOT}ace/Service_Config.h \ - ${ACE_ROOT}ace/Reactor.h \ - ${ACE_ROOT}ace/Handle_Set.h \ - ${ACE_ROOT}ace/sysincludes.h \ - ${ACE_ROOT}ace/config.h \ - ${ACE_ROOT}ace/Handle_Set.i \ - ${ACE_ROOT}ace/Timer_Queue.h \ - ${ACE_ROOT}ace/Event_Handler.h \ - ${ACE_ROOT}ace/Time_Value.h \ - ${ACE_ROOT}ace/Synch.h \ - ${ACE_ROOT}ace/Synch_T.h \ - ${ACE_ROOT}ace/Timer_Queue.i \ - ${ACE_ROOT}ace/Signal.h \ - ${ACE_ROOT}ace/Set.h \ - ${ACE_ROOT}ace/Thread.h \ - ${ACE_ROOT}ace/Token.h \ - ${ACE_ROOT}ace/Reactor.i \ - ${ACE_ROOT}ace/Log_Msg.h \ - ${ACE_ROOT}ace/Log_Record.h \ - ${ACE_ROOT}ace/Log_Priority.h \ - ${ACE_ROOT}ace/Log_Record.i \ - ${ACE_ROOT}ace/Log_Msg.i \ - ${ACE_ROOT}ace/Thread_Specific.h \ - ${ACE_ROOT}ace/Thread_Specific.i \ - ${ACE_ROOT}ace/Service_Object.h \ - ${ACE_ROOT}ace/Shared_Object.h \ - ${ACE_ROOT}ace/Service_Types.h \ - ${ACE_ROOT}ace/Thread_Manager.h \ - Notification_Receiver_Handler.h \ - ${ACE_ROOT}ace/CORBA_Handler.h \ - ../include/Event_Comm_i.h ../include/Notification_Receiver_i.h \ - ../include/Notifier_i.h \ - ${ACE_ROOT}ace/Map_Manager.h \ - ${ACE_ROOT}ace/SString.h \ - ${ACE_ROOT}ace/SString.i \ - ../include/Event_Comm.hh -consumer.o: consumer.cpp \ - ${ACE_ROOT}ace/Log_Msg.h \ - ${ACE_ROOT}ace/Log_Record.h \ - ${ACE_ROOT}ace/sysincludes.h \ - ${ACE_ROOT}ace/config.h \ - ${ACE_ROOT}ace/Log_Priority.h \ - ${ACE_ROOT}ace/Log_Record.i \ - ${ACE_ROOT}ace/Log_Msg.i \ - ${ACE_ROOT}ace/Thread_Specific.h \ - ${ACE_ROOT}ace/Synch.h \ - ${ACE_ROOT}ace/Time_Value.h \ - ${ACE_ROOT}ace/Synch_T.h \ - ${ACE_ROOT}ace/Thread_Specific.i \ - Notification_Receiver_Handler.h \ - ${ACE_ROOT}ace/CORBA_Handler.h \ - ${ACE_ROOT}ace/Service_Config.h \ - ${ACE_ROOT}ace/Reactor.h \ - ${ACE_ROOT}ace/Handle_Set.h \ - ${ACE_ROOT}ace/Handle_Set.i \ - ${ACE_ROOT}ace/Timer_Queue.h \ - ${ACE_ROOT}ace/Event_Handler.h \ - ${ACE_ROOT}ace/Timer_Queue.i \ - ${ACE_ROOT}ace/Signal.h \ - ${ACE_ROOT}ace/Set.h \ - ${ACE_ROOT}ace/Thread.h \ - ${ACE_ROOT}ace/Token.h \ - ${ACE_ROOT}ace/Reactor.i \ - ${ACE_ROOT}ace/Service_Object.h \ - ${ACE_ROOT}ace/Shared_Object.h \ - ${ACE_ROOT}ace/Service_Types.h \ - ${ACE_ROOT}ace/Thread_Manager.h \ - ../include/Event_Comm_i.h ../include/Notification_Receiver_i.h \ - ../include/Notifier_i.h \ - ${ACE_ROOT}ace/Map_Manager.h \ - ${ACE_ROOT}ace/SString.h \ - ${ACE_ROOT}ace/SString.i \ - ../include/Event_Comm.hh Input_Handler.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.cpp b/apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.cpp deleted file mode 100644 index 2574aff6e65..00000000000 --- a/apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// $Id$ - -#include "Notification_Receiver_Handler.h" - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) - -#if defined (ACE_HAS_MT_ORBIX) && (ACE_HAS_MT_ORBIX != 0) -typedef ACE_MT_CORBA_Handler CORBA_HANDLER; -#else -typedef ACE_ST_CORBA_Handler CORBA_HANDLER; -#endif /* ACE_HAS_MT_ORBIX */ - -int -Notification_Receiver_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ -// ACE_ST_CORBA_Handler::remove_service (Event_Comm_Notification_Receiver_IMPL); - - if (this->receiver_ != 0) - { - ACE_DEBUG ((LM_DEBUG, "closing down Notification_Receiver_Handler\n")); - CORBA_HANDLER::instance ()->deactivate_service (Event_Comm_Notification_Receiver_IMPL, - this->receiver_->_marker ()); - CORBA::release (this->receiver_); - this->receiver_ = 0; - CORBA::release (this->notifier_); - this->notifier_ = 0; - // *Must* be allocated dynamically in order to delete this! - delete this; - } - return 0; -} - -Notification_Receiver_Handler::Notification_Receiver_Handler (int argc, char *argv[]) - : notifier_ (0), - receiver_ (0) -{ - const char *server_name = Event_Comm_Notification_Receiver_IMPL; - char buf[BUFSIZ]; - char *receiver_marker = buf; - char *filtering_criteria; - char *host; - char *notifier_marker; - char *service_location = argv[0]; - - // First see if we have any environment variables. - filtering_criteria = ACE_OS::getenv ("FILTERING_CRITERIA"); - host = ACE_OS::getenv ("HOST"); - notifier_marker = ACE_OS::getenv ("NOTIFIER_MARKER"); - - // Then override these variables with command-line arguments. - filtering_criteria = argc > 1 ? argv[1] : ""; - host = argc > 2 ? argv[2] : "tango.cs"; - notifier_marker = argc > 3 ? argv[3] : "notifier:" Event_Comm_Notifier_IR; - - CORBA::Orbix.setDiagnostics (0); - - struct utsname name; - - // Make the marker name be the "/hostname/processid" - ACE_OS::uname (&name); - sprintf (buf, "/%s/%d", name.nodename, ACE_OS::getpid ()); - - CORBA_HANDLER::instance ()->activate_service (Event_Comm_Notification_Receiver_IMPL, - receiver_marker, service_location); - - // Create the receiver object. - this->receiver_ = new TIE_Event_Comm_Notification_Receiver (Notification_Receiver_i) - (new Notification_Receiver_i); - - this->receiver_->_marker (receiver_marker); - - ACE_ASSERT (this->receiver_); - - TRY { - // Get a binding to the notifier. - this->notifier_ = Event_Comm::Notifier::_bind (notifier_marker, host, IT_X); - - if (this->notifier_ != CORBA::OBJECT_NIL) - // Subscribe ourselves with the notifier's broker. - this->notifier_->subscribe (this->receiver_, - filtering_criteria, IT_X); - } CATCHANY { - cerr << "Unexpected exception " << IT_X << endl; - ACE_OS::exit (1); - } ENDTRY; - // Print out context. - - receiver_marker = (char *) this->receiver_->_marker (); - CORBA::BOA::activationMode mode = CORBA::Orbix.myActivationMode (); - ACE_DEBUG ((LM_DEBUG, "starting up a %spersistent server in mode %d with marker name %s\n", - mode == CORBA::BOA::persistentActivationMode ? "" : "non-", - mode, receiver_marker)); -} - -Event_Comm::Notification_Receiver * -Notification_Receiver_Handler::receiver (void) -{ - return this->receiver_; -} - -Event_Comm::Notifier * -Notification_Receiver_Handler::notifier (void) -{ - return this->notifier_; -} - -// Destroy a Receiver target object. - -Notification_Receiver_Handler::~Notification_Receiver_Handler (void) -{ - this->handle_close (-1, ACE_Event_Handler::ALL_EVENTS_MASK); -} - -#endif /* ACE_HAS_ORBIX */ diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.h b/apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.h deleted file mode 100644 index 9d82c1eafc2..00000000000 --- a/apps/Orbix-Examples/Event_Comm/Consumer/Notification_Receiver_Handler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - - -// ============================================================================ -// -// = LIBRARY -// EventComm -// -// = FILENAME -// Notifier_Receiver_Handler.h -// -// = DESCRIPTION -// Subclass of Corba_Handler that sets up the Notification_Receiver handler -// for use with the ACE ACE_Reactor. -// -// = AUTHOR -// Douglas C. Schmidt (schmidt@cs.wustl.edu) -// -// ============================================================================ - -#if !defined (_NOTIFICATION_RECEIVER_HANDLER_H) -#define _NOTIFICATION_RECEIVER_HANDLER_H - -#include "ace/CORBA_Handler.h" -#include "Event_Comm_i.h" - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) - -class Notification_Receiver_Handler - // = TITLE - // Subclass of Corba_Handler that sets up the Notification Receiver handler - // for use with the ACE ACE_Reactor. - // - // = DESCRIPTION - // Note that this class doesn't inherit from ACE_ST_CORBA_Handler (unlike - // the Supplier's Notifier_Handler class). Instead, it uses an - // alternative interface that can be called directly. -{ -public: - Notification_Receiver_Handler (int argc, char *argv[]); - - Event_Comm::Notification_Receiver *receiver (void); - Event_Comm::Notifier *notifier (void); - - virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::NULL_MASK); - // Close down the handler. - -private: - ~Notification_Receiver_Handler (void); - // Ensure dynamic allocation. - - Event_Comm::Notification_Receiver *receiver_; - // Pointer to an IDL <Notification_Receiver> proxy object. - - Event_Comm::Notifier *notifier_; - // Pointer to an IDL <Notifier> proxy object. -}; - -#endif /* ACE_HAS_ORBIX */ -#endif /* _NOTIFICATION_RECEIVER_HANDLER_H */ diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp b/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp deleted file mode 100644 index 29137661ce3..00000000000 --- a/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Consumer driver for the Orbix Notification example. - - -#include "Notification_Receiver_Handler.h" -#include "Input_Handler.h" - -#if defined (ACE_HAS_ORBIX) && (ACE_HAS_ORBIX != 0) - -class Consumer : public ACE_Event_Handler -{ -public: - Consumer (int argc, char *argv[]); - ~Consumer (void); - - void run (void); - // Execute the consumer; - -private: - virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); - - virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); - - Input_Handler *ih_; - // Handler for keyboard input. - - Notification_Receiver_Handler *nrh_; - // Handler for CORBA Consumer. - - ACE_Service_Config daemon_; - // ACE server event-loop mechanism. -}; - -int -Consumer::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ - ACE_DEBUG ((LM_DEBUG, "closing down Consumer\n")); - return 0; -} - -int -Consumer::handle_signal (int signum, siginfo_t *, ucontext_t *) -{ - ACE_DEBUG ((LM_DEBUG, "%S\n", signum)); - - // Indicate that the consumer initiated the shutdown. - this->ih_->consumer_initiated_shutdown (1); - - // Shut down the event loop. - ACE_Reactor::end_event_loop(); - return 0; -} - -// Run the event loop until someone calls -// calls ACE_Reactor::end_event_loop(). - -void -Consumer::run (void) -{ - if (ACE_Reactor::run_event_loop () == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "run_reactor_event_loop")); -} - -Consumer::Consumer (int argc, char *argv[]) - : ih_ (0), - nrh_ (0) -{ - // Initialize the server. - if (this->daemon_.open (argc, argv) == -1) - { - if (errno == ENOENT) // There's no svc.conf file, so use static linking... - { - ACE_DEBUG ((LM_DEBUG, "no config file, using static binding\n")); - // The constructor registers the handlers... - this->nrh_ = new Notification_Receiver_Handler (argc, argv); - ACE_ASSERT (this->nrh_ != 0); - this->ih_ = new Input_Handler (this->nrh_); - ACE_ASSERT (this->ih_ != 0); - } - else - ACE_ERROR ((LM_ERROR, "%p\n%a", "open", 1)); - } - - if (ACE_Reactor::instance ()->register_handler (SIGINT, this) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "register_handler")); -} - -Consumer::~Consumer (void) -{ - // Free up the handlers if they were statically bound. - this->ih_->handle_close (); - this->nrh_->handle_close (); -} - -int -main (int argc, char *argv[]) -{ - // Initialize the supplier and consumer object references. - Consumer consumer (argc, argv); - - // Loop forever handling events. - consumer.run (); - - return 0; -} -#else /* !defined ACE_HAS_ORBIX */ -int -main (int argc, char *argv[]) -{ - ACE_ERROR_RETURN ((LM_ERROR, "you must have Orbix to run application %s\n", argv[0]), 1); -} -#endif /* ACE_HAS_ORBIX */ |