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.
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
>
15 // Performs the actual initialization.
16 Event_Transceiver (int argc
, ACE_TCHAR
*argv
[]);
18 // No-op constructor (required by the <ACE_Connector>).
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
);
36 // Reads data from socket and writes to ACE_STDOUT.
39 // Writes data from ACE_STDIN to socket.
42 // Parse the command-line arguments.
43 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
45 // Port number of event server.
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 */