Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / ASX / Event_Server / Transceiver / transceiver.h
blob69a7cbe5f84b6d992b1c7d23c54ce51726e4884f
1 /* -*- C++ -*- */
2 #ifndef ACE_TRANSCEIVER_H
3 #define ACE_TRANSCEIVER_H
5 #include "ace/SOCK_Stream.h"
6 #include "ace/Svc_Handler.h"
8 // Generate and receives messages from the event server.
9 //
10 // This class is both a consumer and supplier of events, i.e.,
11 // it's a ``transceiver.''
12 class Event_Transceiver : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
14 public:
15 // Performs the actual initialization.
16 Event_Transceiver (int argc, ACE_TCHAR *argv[]);
18 // No-op constructor (required by the <ACE_Connector>).
19 Event_Transceiver ();
21 // = Svc_Handler hook called by the <ACE_Connector>.
22 // Initialize the transceiver when we are connected.
23 virtual int open (void *);
25 // = Demultplexing hooks from the <ACE_Reactor>.
26 // Receive data from STDIN or socket.
27 virtual int handle_input (ACE_HANDLE);
29 // Close down via SIGINT.
30 virtual int handle_signal (int signum, siginfo_t *, ucontext_t *);
32 // Close down the event loop.
33 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
35 private:
36 // Reads data from socket and writes to ACE_STDOUT.
37 int receiver ();
39 // Writes data from ACE_STDIN to socket.
40 int transmitter ();
42 // Parse the command-line arguments.
43 int parse_args (int argc, ACE_TCHAR *argv[]);
45 // Port number of event server.
46 u_short port_number_;
48 // Name of event server.
49 const ACE_TCHAR *host_name_;
51 // Are we playing the Consumer or Supplier role?
52 const ACE_TCHAR *role_;
55 #endif /* ACE_TRANSCEIVER_H */