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/Acceptor.h"
13 #include "ace/SPIPE_Stream.h"
14 #include "ace/SPIPE_Acceptor.h"
15 #include "ace/Asynch_IO.h"
17 // This only works on Win32 platforms and on Unix platforms
18 // supporting POSIX aio calls.
19 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
21 // This is the class that does the work once the ACE_Oneshot_Acceptor
22 // has accepted a connection.
24 class Svc_Handler
: public ACE_Svc_Handler
<ACE_SPIPE_STREAM
, ACE_NULL_SYNCH
>, public ACE_Handler
30 virtual int open (void *);
32 virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result
&result
);
33 // This is called when asynchronous read from the socket complete
34 // Handle data from the client.
37 ACE_Asynch_Read_Stream ar_
;
38 ACE_Message_Block mb_
;
41 class IPC_Server
: public ACE_Oneshot_Acceptor
<Svc_Handler
, ACE_SPIPE_ACCEPTOR
>
47 // = Dynamic linking hooks.
48 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
49 // Initialize the network server.
52 // Close down the server.
55 // Run the interative service.
58 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
59 // Parse command-line arguments.
62 // Size of thread pool to use.
64 ACE_TCHAR rendezvous_
[MAXPATHLEN
+ 1];
65 // Meeting place for pipe.
68 // Keeps track of when we shut down due to receipt of the SIGINT
71 int handle_signal (int signum
, siginfo_t
*, ucontext_t
*);
72 // Signal handler method.
75 #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */
76 #endif /* SP_ACCEPTOR_H */