[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / SOCK_SEQPACK_Association.h
blob6189d1a99874ad45622b0eff5d3ff951d55fb568
1 // -*- C++ -*-
3 //=============================================================================
4 /**
6 * @file SOCK_SEQPACK_Association.h
8 * $Id: SOCK_SEQPACK_Association.h 80826 2008-03-04 14:51:23Z wotte $
10 * @author Patrick J. Lardieri <plardier@atl.lmco.com>
11 * @author Gaurav Naik, Lockheed Martin ATL
12 * @author based on SOCK_Stream
13 * by Douglas C. Schmidt <schmidt@cs.wustl.edu>
16 //=============================================================================
18 #ifndef ACE_SOCK_SEQPACK_ASSOCIATION_H
19 #define ACE_SOCK_SEQPACK_ASSOCIATION_H
21 #include /**/ "ace/pre.h"
23 #include /**/ "ace/ACE_export.h"
25 #if !defined (ACE_LACKS_PRAGMA_ONCE)
26 # pragma once
27 #endif /* ACE_LACKS_PRAGMA_ONCE */
29 #include "ace/SOCK_IO.h"
30 #include "ace/Multihomed_INET_Addr.h"
32 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
34 // Forward declarations.
35 class ACE_Message_Block;
37 /**
38 * @class ACE_SOCK_SEQPACK_Association
40 * @brief Defines the methods in the ACE_SOCK_SEQPACK_Association abstraction.
42 * This adds additional wrapper methods atop the <ACE_SOCK_IO>
43 * class.
45 * @a buf is the buffer to write from or receive into.
46 * @a len is the number of bytes to transfer.
47 * The @a timeout parameter in the following methods indicates how
48 * long to blocking trying to transfer data. If @a timeout == 0,
49 * then the call behaves as a normal send/recv call, i.e., for
50 * blocking sockets, the call will block until action is possible;
51 * for non-blocking sockets, EWOULDBLOCK will be returned if no
52 * action is immediately possible.
53 * If @a timeout != 0, the call will wait for data to arrive no longer
54 * than the relative time specified in *@a timeout.
55 * The "_n()" I/O methods keep looping until all the data has been
56 * transferred. These methods also work for sockets in non-blocking
57 * mode i.e., they keep looping on EWOULDBLOCK. @a timeout is used
58 * to make sure we keep making progress, i.e., the same timeout
59 * value is used for every I/O operation in the loop and the timeout
60 * is not counted down.
61 * The return values for the "*_n()" methods match the return values
62 * from the non "_n()" methods and are specified as follows:
63 * - On complete transfer, the number of bytes transferred is returned.
64 * - On timeout, -1 is returned, errno == ETIME.
65 * - On error, -1 is returned, errno is set to appropriate error.
66 * - On EOF, 0 is returned, errno is irrelevant.
68 * On partial transfers, i.e., if any data is transferred before
69 * timeout/error/EOF, <bytes_transferred> will contain the number of
70 * bytes transferred.
71 * Methods with <iovec> parameter are I/O vector variants of the I/O
72 * operations.
73 * Methods with the extra @a flags argument will always result in
74 * <send> getting called. Methods without the extra @a flags argument
75 * will result in <send> getting called on Win32 platforms, and
76 * <write> getting called on non-Win32 platforms.
78 class ACE_Export ACE_SOCK_SEQPACK_Association : public ACE_SOCK_IO
80 public:
81 // Initialization and termination methods.
82 /// Constructor.
83 ACE_SOCK_SEQPACK_Association (void);
85 /// Constructor (sets the underlying ACE_HANDLE with <h>).
86 ACE_SOCK_SEQPACK_Association (ACE_HANDLE h);
88 /// Destructor.
89 ~ACE_SOCK_SEQPACK_Association (void);
91 /**
92 * Return local endpoint addresses in the referenced array of
93 * ACE_INET_Addr, which should have the specified @a size. If the
94 * number of local endpoint addresses is less than @a size, then
95 * @a size will be set to this number. If successful, the method
96 * returns 0, otherwise returns -1.
98 int get_local_addrs (ACE_INET_Addr *addrs, size_t &size) const;
101 * Return remote endpoint addresses in the referenced array of
102 * ACE_INET_Addr, which should have the specified @a size. If the
103 * number of remote endpoint addresses is less than @a size, then
104 * @a size will be set to this number. If successful, the method
105 * returns 0, otherwise returns -1.
107 int get_remote_addrs (ACE_INET_Addr *addrs, size_t &size) const;
109 // = I/O functions.
111 /// Try to recv exactly @a len bytes into @a buf from the connected socket.
112 ssize_t recv_n (void *buf,
113 size_t len,
114 int flags,
115 const ACE_Time_Value *timeout = 0,
116 size_t *bytes_transferred = 0) const;
118 /// Try to recv exactly @a len bytes into @a buf from the connected socket.
119 ssize_t recv_n (void *buf,
120 size_t len,
121 const ACE_Time_Value *timeout = 0,
122 size_t *bytes_transferred = 0) const;
124 /// Receive an <iovec> of size <iovcnt> from the connected socket.
125 ssize_t recvv_n (iovec iov[],
126 int iovcnt,
127 const ACE_Time_Value *timeout = 0,
128 size_t *bytes_transferred = 0) const;
130 /// Try to send exactly @a len bytes from @a buf to the connection socket.
131 ssize_t send_n (const void *buf,
132 size_t len,
133 int flags,
134 const ACE_Time_Value *timeout = 0,
135 size_t *bytes_transferred = 0) const;
137 /// Try to send exactly @a len bytes from @a buf to the connected socket.
138 ssize_t send_n (const void *buf,
139 size_t len,
140 const ACE_Time_Value *timeout = 0,
141 size_t *bytes_transferred = 0) const;
143 /// Send all the @a message_blocks chained through their <next> and
144 /// <cont> pointers. This call uses the underlying OS gather-write
145 /// operation to reduce the domain-crossing penalty.
146 ssize_t send_n (const ACE_Message_Block *message_block,
147 const ACE_Time_Value *timeout = 0,
148 size_t *bytes_transferred = 0) const;
150 /// Send an <iovec> of size <iovcnt> to the connected socket.
151 ssize_t sendv_n (const iovec iov[],
152 int iovcnt,
153 const ACE_Time_Value *timeout = 0,
154 size_t *bytes_transferred = 0) const;
156 // = Send/receive ``urgent'' data (see TCP specs...).
157 ssize_t send_urg (const void *ptr,
158 size_t len = sizeof (char),
159 const ACE_Time_Value *timeout = 0) const;
161 ssize_t recv_urg (void *ptr,
162 size_t len = sizeof (char),
163 const ACE_Time_Value *timeout = 0) const;
165 // = Selectively close endpoints.
166 /// Close down the reader.
167 int close_reader (void);
169 /// Close down the writer.
170 int close_writer (void);
173 * Close down the socket (we need this to make things work correctly
174 * on Win32, which requires use to do a <close_writer> before doing
175 * the close to avoid losing data). */
176 int close (void);
179 * Abort the association according to RFC 2960 9.1 through the API
180 * in draft-ietf-tsvwg-sctpsocket-09 7.1.4.
182 int abort (void);
184 // = Meta-type info
185 typedef ACE_Multihomed_INET_Addr PEER_ADDR;
187 /// Dump the state of an object.
188 void dump (void) const;
190 /// Declare the dynamic allocation hooks.
191 ACE_ALLOC_HOOK_DECLARE;
194 ACE_END_VERSIONED_NAMESPACE_DECL
196 #if defined (__ACE_INLINE__)
197 #include "ace/SOCK_SEQPACK_Association.inl"
198 #endif /* __ACE_INLINE__ */
200 #include /**/ "ace/post.h"
202 #endif /* ACE_SOCK_SEQPACK_ASSOCIATION_H */