5 #include "ace/Svc_Handler.h"
6 #include "ace/Service_Config.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #include "ace/SPIPE_Stream.h"
13 #include "ace/Connector.h"
14 #include "ace/SPIPE_Connector.h"
15 #include "ace/Sig_Adapter.h"
17 class Peer_Handler
: public ACE_Svc_Handler
<ACE_SPIPE_STREAM
, ACE_NULL_SYNCH
>
22 Peer_Handler (int iterations
= 0);
23 // <iterations> is the number of buffers to send. If <iterations>
24 // == 0, then read from stdin.
28 virtual int open (void * = 0);
29 // Activate the handler when connection is established.
31 // = Demultiplexing hooks.
32 virtual int handle_input (ACE_HANDLE
);
33 virtual int handle_close (ACE_HANDLE handle
= ACE_INVALID_HANDLE
,
34 ACE_Reactor_Mask mask
= ACE_Event_Handler::ALL_EVENTS_MASK
);
36 virtual ACE_HANDLE
get_handle () const;
42 // No. of buffers to send.
45 class IPC_Client
: public ACE_Connector
<Peer_Handler
, ACE_SPIPE_CONNECTOR
>
52 // = Dynamic linking hooks.
53 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
54 // Initialize the IPC client.
57 // Destroy the IPC client.
62 virtual int handle_close (ACE_HANDLE
, ACE_Reactor_Mask
);
63 // Report connection errors.
66 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
67 // Parse command-line arguments.
70 // Number of times to send a buffer.
72 ACE_TCHAR rendezvous_
[MAXPATHLEN
+ 1];
73 // Meeting place for pipe.
75 ACE_Sig_Adapter done_handler_
;
76 // Keeps track of when we shut down due to receipt of the SIGINT
80 #endif /* SP_CONNECTOR_H */