3 //=============================================================================
7 * $Id: TLI_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $
11 //=============================================================================
14 #ifndef ACE_TLI_ACCEPTOR_H
15 #define ACE_TLI_ACCEPTOR_H
16 #include /**/ "ace/pre.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/TLI_Stream.h"
25 #include "ace/Default_Constants.h"
27 #if defined (ACE_HAS_TLI)
29 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 // Forward reference...
32 class ACE_TLI_Request_Queue
;
36 * @class ACE_TLI_Acceptor
38 * @brief Defines the member functions for ACE_TLI_Acceptor abstraction.
40 * This class implements the algorithm described in Steve Rago's
41 * book on System V UNIX network programming. It basically
42 * makes TLI look like the C++ SOCK_SAP socket wrappers with
43 * respect to establishing passive-mode listener endpoints.
45 class ACE_Export ACE_TLI_Acceptor
: public ACE_TLI
48 friend class ACE_Request_Queue
;
50 // = Initialization and termination methods.
51 /// Default constructor.
52 ACE_TLI_Acceptor (void);
54 /// Initiate a passive mode socket.
55 ACE_TLI_Acceptor (const ACE_Addr
&remote_sap
,
58 struct t_info
*info
= 0,
59 int backlog
= ACE_DEFAULT_BACKLOG
,
60 const char device
[] = ACE_TLI_TCP_DEVICE
);
62 /// Initiate a passive mode socket.
63 ACE_HANDLE
open (const ACE_Addr
&remote_sap
,
66 struct t_info
*info
= 0,
67 int backlog
= ACE_DEFAULT_BACKLOG
,
68 const char device
[] = ACE_TLI_TCP_DEVICE
);
70 /// Close down the acceptor and release resources.
73 // = Passive connection acceptance method.
76 * Accept a new data transfer connection. A @a timeout of 0 means
77 * block forever, a @a timeout of {0, 0} means poll. <restart> == 1
78 * means "restart if interrupted."
80 int accept (ACE_TLI_Stream
&new_tli_sap
,
81 ACE_Addr
*remote_addr
= 0,
82 ACE_Time_Value
*timeout
= 0,
84 int reset_new_handle
= 0,
90 typedef ACE_INET_Addr PEER_ADDR
;
91 typedef ACE_TLI_Stream PEER_STREAM
;
93 /// Dump the state of an object.
94 void dump (void) const;
96 /// Declare the dynamic allocation hooks.
97 ACE_ALLOC_HOOK_DECLARE
;
100 /// Network "device" we are using.
103 /// Number of connections to queue.
106 /// Are we using "tirdwr" mod?
109 /// Handle TLI accept insanity...
110 int handle_async_event (int restart
, int rwflag
);
112 /// Used for queueing up pending requests.
113 ACE_TLI_Request_Queue
*queue_
;
115 /// Used for handling disconnects
116 struct t_discon
*disp_
;
119 ACE_END_VERSIONED_NAMESPACE_DECL
121 #endif /* ACE_HAS_TLI */
122 #include /**/ "ace/post.h"
123 #endif /* ACE_TLI_ACCEPTOR_H */