[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / SOCK_IO.h
blob1541f5ed0f33a8eb3818968da34387c14e16c4a1
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file SOCK_IO.h
7 * $Id: SOCK_IO.h 81014 2008-03-19 11:41:31Z johnnyw $
9 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
11 //==========================================================================
13 #ifndef ACE_SOCK_IO_H
14 #define ACE_SOCK_IO_H
16 #include /**/ "ace/pre.h"
18 #include "ace/SOCK.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/ACE.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 /**
29 * @class ACE_SOCK_IO
31 * @brief Defines the methods for the ACE socket wrapper I/O routines
32 * (e.g., send/recv).
34 * If @a timeout == 0, then the call behaves as a normal
35 * send/recv call, i.e., for blocking sockets, the call will
36 * block until action is possible; for non-blocking sockets,
37 * -1 will be returned with errno == EWOULDBLOCK if no action is
38 * immediately possible.
39 * If @a timeout != 0, the call will wait until the relative time
40 * specified in *@a timeout elapses.
41 * Errors are reported by -1 and 0 return values. If the
42 * operation times out, -1 is returned with @c errno == ETIME.
43 * If it succeeds the number of bytes transferred is returned.
44 * Methods with the extra @a flags argument will always result in
45 * @c send getting called. Methods without the extra @a flags
46 * argument will result in @c send getting called on Win32
47 * platforms, and @c write getting called on non-Win32 platforms.
49 class ACE_Export ACE_SOCK_IO : public ACE_SOCK
51 public:
52 // = Initialization and termination methods.
54 /// Constructor.
55 ACE_SOCK_IO (void);
57 /// Destructor.
58 ~ACE_SOCK_IO (void);
60 /// Recv an @a n byte buffer from the connected socket.
61 ssize_t recv (void *buf,
62 size_t n,
63 int flags,
64 const ACE_Time_Value *timeout = 0) const;
66 /// Recv an @a n byte buffer from the connected socket.
67 ssize_t recv (void *buf,
68 size_t n,
69 const ACE_Time_Value *timeout = 0) const;
71 /// Recv an <iovec> of size @a n from the connected socket.
72 ssize_t recvv (iovec iov[],
73 int n,
74 const ACE_Time_Value *timeout = 0) const;
76 /**
77 * Allows a client to read from a socket without having to provide a
78 * buffer to read. This method determines how much data is in the
79 * socket, allocates a buffer of this size, reads in the data, and
80 * returns the number of bytes read. The caller is responsible for
81 * deleting the member in the <iov_base> field of @a io_vec using
82 * delete [] io_vec->iov_base.
84 ssize_t recvv (iovec *io_vec,
85 const ACE_Time_Value *timeout = 0) const;
87 /// Recv @a n varargs messages to the connected socket.
88 ssize_t recv (size_t n,
89 ...) const;
91 /// Recv @a n bytes via Win32 @c ReadFile using overlapped I/O.
92 ssize_t recv (void *buf,
93 size_t n,
94 ACE_OVERLAPPED *overlapped) const;
96 /// Send an @a n byte buffer to the connected socket.
97 ssize_t send (const void *buf,
98 size_t n,
99 int flags,
100 const ACE_Time_Value *timeout = 0) const;
102 /// Send an @a n byte buffer to the connected socket.
103 ssize_t send (const void *buf,
104 size_t n,
105 const ACE_Time_Value *timeout = 0) const;
107 /// Send an @c iovec of size @a n to the connected socket.
108 ssize_t sendv (const iovec iov[],
109 int n,
110 const ACE_Time_Value *timeout = 0) const;
112 /// Send @a n varargs messages to the connected socket.
113 ssize_t send (size_t n,
114 ...) const;
116 /// Send @a n bytes via Win32 <WriteFile> using overlapped I/O.
117 ssize_t send (const void *buf,
118 size_t n,
119 ACE_OVERLAPPED *overlapped) const;
121 /// Dump the state of an object.
122 void dump (void) const;
124 /// Declare the dynamic allocation hooks.
125 ACE_ALLOC_HOOK_DECLARE;
128 ACE_END_VERSIONED_NAMESPACE_DECL
130 #if defined (__ACE_INLINE__)
131 #include "ace/SOCK_IO.inl"
132 #endif /* __ACE_INLINE__ */
134 #include /**/ "ace/post.h"
136 #endif /* ACE_SOCK_IO_H */