GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / TLI_Acceptor.h
blob506fbab0ac3e09b925dad4d41a1cecd3062e5d20
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file TLI_Acceptor.h
7 * @author Doug Schmidt
8 */
9 //=============================================================================
12 #ifndef ACE_TLI_ACCEPTOR_H
13 #define ACE_TLI_ACCEPTOR_H
14 #include /**/ "ace/pre.h"
16 #include "ace/TLI.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/TLI_Stream.h"
23 #include "ace/Default_Constants.h"
25 #if defined (ACE_HAS_TLI)
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 // Forward reference...
30 class ACE_TLI_Request_Queue;
31 class ACE_Time_Value;
33 /**
34 * @class ACE_TLI_Acceptor
36 * @brief Defines the member functions for ACE_TLI_Acceptor abstraction.
38 * This class implements the algorithm described in Steve Rago's
39 * book on System V UNIX network programming. It basically
40 * makes TLI look like the C++ SOCK_SAP socket wrappers with
41 * respect to establishing passive-mode listener endpoints.
43 class ACE_Export ACE_TLI_Acceptor : public ACE_TLI
45 public:
46 friend class ACE_Request_Queue;
48 /// Default constructor.
49 ACE_TLI_Acceptor (void);
51 /// Initiate a passive mode socket.
52 ACE_TLI_Acceptor (const ACE_Addr &remote_sap,
53 int reuse_addr = 0,
54 int oflag = O_RDWR,
55 struct t_info *info = 0,
56 int backlog = ACE_DEFAULT_BACKLOG,
57 const char device[] = ACE_TLI_TCP_DEVICE);
59 /// Initiate a passive mode socket.
60 ACE_HANDLE open (const ACE_Addr &remote_sap,
61 int reuse_addr = 0,
62 int oflag = O_RDWR,
63 struct t_info *info = 0,
64 int backlog = ACE_DEFAULT_BACKLOG,
65 const char device[] = ACE_TLI_TCP_DEVICE);
67 /// Close down the acceptor and release resources.
68 int close (void);
70 // = Passive connection acceptance method.
72 /**
73 * Accept a new data transfer connection. A @a timeout of 0 means
74 * block forever, a @a timeout of {0, 0} means poll. <restart> == 1
75 * means "restart if interrupted."
77 int accept (ACE_TLI_Stream &new_tli_sap,
78 ACE_Addr *remote_addr = 0,
79 ACE_Time_Value *timeout = 0,
80 bool restart = true,
81 bool reset_new_handle = false,
82 int rwflag = 1,
83 netbuf *udata = 0,
84 netbuf *opt = 0);
86 // = Meta-type info
87 typedef ACE_INET_Addr PEER_ADDR;
88 typedef ACE_TLI_Stream PEER_STREAM;
90 /// Dump the state of an object.
91 void dump (void) const;
93 /// Declare the dynamic allocation hooks.
94 ACE_ALLOC_HOOK_DECLARE;
96 private:
97 /// Network "device" we are using.
98 const char *device_;
100 /// Number of connections to queue.
101 int backlog_;
103 /// Are we using "tirdwr" mod?
104 int rwflag_;
106 /// Handle TLI accept insanity...
107 int handle_async_event (bool restart, int rwflag);
109 /// Used for queueing up pending requests.
110 ACE_TLI_Request_Queue *queue_;
112 /// Used for handling disconnects
113 struct t_discon *disp_;
116 ACE_END_VERSIONED_NAMESPACE_DECL
118 #endif /* ACE_HAS_TLI */
119 #include /**/ "ace/post.h"
120 #endif /* ACE_TLI_ACCEPTOR_H */