2 #ifndef _HANDLE_THR_STREAM_H
3 #define _HANDLE_THR_STREAM_H
5 #include "ace/Acceptor.h"
6 #include "ace/Svc_Handler.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #include "ace/Service_Types.h"
14 #if defined (ACE_HAS_THREADS)
16 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
>
17 class Handle_Thr_Acceptor
: public ACE_Strategy_Acceptor
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>
19 // This factory creates new <SVC_HANDLERS> and runs them with the
20 // configured <ACE_Thread_Strategy>.
23 Handle_Thr_Acceptor ();
24 ~Handle_Thr_Acceptor ();
26 // = Dynamic linking hooks.
27 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
28 virtual int info (ACE_TCHAR
**, size_t) const;
32 ACE_Thread_Manager thr_mgr_
;
35 ACE_Thread_Strategy
<SVC_HANDLER
> thr_strategy_
;
36 // Threading strategy.
42 template <ACE_PEER_STREAM_1
>
43 class CLI_Stream
: public ACE_Svc_Handler
<ACE_PEER_STREAM_2
, ACE_MT_SYNCH
>
45 // This class interacts with the client, running in a separate
46 // thread and handles connections from remote TCP/IP connections.
49 CLI_Stream (ACE_Thread_Manager
* = 0);
51 virtual int open (void *);
54 virtual int close (u_long
);
55 // Close down the service.
58 // Execute the service.
61 typedef ACE_Svc_Handler
<ACE_PEER_STREAM_2
, ACE_MT_SYNCH
> inherited
;
64 extern ACE_Service_Object_Type rts
;
66 #include "Handle_Thr_Stream.cpp"
67 #endif /* ACE_HAS_THREADS */
68 #endif /* _HANDLE_THR_STREAM_H */