[6916] Fixed typos in spell checking code.
[getmangos.git] / dep / ACE_wrappers / ace / TLI_Acceptor.h
bloba24b32241212d23f9619f7065a7f944f003d61b6
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file TLI_Acceptor.h
7 * $Id: TLI_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Doug Schmidt
11 //=============================================================================
14 #ifndef ACE_TLI_ACCEPTOR_H
15 #define ACE_TLI_ACCEPTOR_H
16 #include /**/ "ace/pre.h"
18 #include "ace/TLI.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # 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;
33 class ACE_Time_Value;
35 /**
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
47 public:
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,
56 int reuse_addr = 0,
57 int oflag = O_RDWR,
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,
64 int reuse_addr = 0,
65 int oflag = O_RDWR,
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.
71 int close (void);
73 // = Passive connection acceptance method.
75 /**
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,
83 int restart = 1,
84 int reset_new_handle = 0,
85 int rwflag = 1,
86 netbuf *udata = 0,
87 netbuf *opt = 0);
89 // = Meta-type info
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;
99 private:
100 /// Network "device" we are using.
101 const char *device_;
103 /// Number of connections to queue.
104 int backlog_;
106 /// Are we using "tirdwr" mod?
107 int rwflag_;
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 */