File: socket_8h.html

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (337 lines) | stat: -rw-r--r-- 28,505 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: interface/wx/socket.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
 <tbody>
 <tr>
  <td id="projectlogo">
    <a href="http://www.wxwidgets.org/" target="_new">
      <img alt="wxWidgets" src="logo.png"/>
    </a>
  </td>
  <td style="padding-left: 0.5em; text-align: right;">
   <span id="projectnumber">Version: 3.0.2</span>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Categories</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_60feedc7276cc318b43f4d4f48ac8f8e.html">interface</a></li><li class="navelem"><a class="el" href="dir_4fb5f442218c03949e30a92e7978b03f.html">wx</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">socket.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_i_paddress.html">wxIPaddress</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classwx_i_paddress.html" title="wxIPaddress is an abstract base class for all internet protocol address objects.">wxIPaddress</a> is an abstract base class for all internet protocol address objects.  <a href="classwx_i_paddress.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_i_p_v4address.html">wxIPV4address</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A class for working with IPv4 network addresses.  <a href="classwx_i_p_v4address.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_server.html">wxSocketServer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_client.html">wxSocketClient</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_sock_address.html">wxSockAddress</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">You are unlikely to need to use this class: only <a class="el" href="classwx_socket_base.html" title="wxSocketBase is the base class for all socket-related objects, and it defines all basic IO functional...">wxSocketBase</a> uses it.  <a href="classwx_sock_address.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_event.html">wxSocketEvent</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This event class contains information about socket events.  <a href="classwx_socket_event.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_socket_base.html">wxSocketBase</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classwx_socket_base.html" title="wxSocketBase is the base class for all socket-related objects, and it defines all basic IO functional...">wxSocketBase</a> is the base class for all socket-related objects, and it defines all basic IO functionality.  <a href="classwx_socket_base.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_datagram_socket.html">wxDatagramSocket</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:aa6e1c1635ef97512c7a0d0c0c7a5db31"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#aa6e1c1635ef97512c7a0d0c0c7a5db31">wxSOCKET_T</a></td></tr>
<tr class="memdesc:aa6e1c1635ef97512c7a0d0c0c7a5db31"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of the native socket.  <a href="#aa6e1c1635ef97512c7a0d0c0c7a5db31"></a><br/></td></tr>
<tr class="separator:aa6e1c1635ef97512c7a0d0c0c7a5db31"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:aec4f3fb4ed18dd9b1fe503750ec4e0f6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6">wxSocketError</a> { <br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6aea08ec67172043a54c3a5097d55a0a7d">wxSOCKET_NOERROR</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6a82ac229a005d26a17cb3454a87fc1c63">wxSOCKET_INVOP</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6aa5bb62f3f65253b53347af737387c308">wxSOCKET_IOERR</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6a371126a5aaeec800ac35d787ba0139ea">wxSOCKET_INVADDR</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6ab67395476ae45e701919ab3294e6183b">wxSOCKET_INVSOCK</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6a27669eab5e472abebdebecf0face6ad4">wxSOCKET_NOHOST</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6a3602281da68a004305231d967575a5cc">wxSOCKET_INVPORT</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6a4682fd14b73a9ad5837321a8f243a146">wxSOCKET_WOULDBLOCK</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6a0f75c06fbe178112f4f79e6f4ce516f5">wxSOCKET_TIMEDOUT</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6ac5f92c61c05bcb7c0e12b020b4dd6cc0">wxSOCKET_MEMERR</a>
<br/>
 }</td></tr>
<tr class="memdesc:aec4f3fb4ed18dd9b1fe503750ec4e0f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">wxSocket error return values.  <a href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6">More...</a><br/></td></tr>
<tr class="separator:aec4f3fb4ed18dd9b1fe503750ec4e0f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ec8996eecae7da1c5fa77c88a45a353"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353">wxSocketEventFlags</a> { <br/>
&#160;&#160;<a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353a27d14981defd0cb66f76ec733c7c6ff1">wxSOCKET_INPUT</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353a8a57cbc400a829a53c64f92950a9e6f6">wxSOCKET_OUTPUT</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353ad5face6ce3a941b3b8bb08971bd6f3fc">wxSOCKET_CONNECTION</a>, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353a9f962bb5acef5cc744995e2fca0ac165">wxSOCKET_LOST</a>
<br/>
 }</td></tr>
<tr class="separator:a2ec8996eecae7da1c5fa77c88a45a353"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fb9092bcdeada2d206bdc74afbbe122"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122aeb1d7a7c69cad4340559486c04d2336c">wxSOCKET_NONE</a> = 0, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122af929a3050e69ff9d3a2dd93795ba2273">wxSOCKET_NOWAIT</a> = 1, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122aea93cf511bb913dfc17571dd29a2de22">wxSOCKET_WAITALL</a> = 2, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122a5736b2f6fb724b2082d861e5a87e1547">wxSOCKET_BLOCK</a> = 4, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122a181fcaf757a6eb4e219a4c9cd473663b">wxSOCKET_REUSEADDR</a> = 8, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122a680d618e39c20b6003bb99d1f0a3443f">wxSOCKET_BROADCAST</a> = 16, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122a2e119a9b0fa2926953a941ff6421e886">wxSOCKET_NOBIND</a> = 32, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122a0fa0e48f2069e4b6bd09eb3f1e0b7624">wxSOCKET_NOWAIT_READ</a> = 64, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122a9a6420537512593d795a52cf7efa320a">wxSOCKET_WAITALL_READ</a> = 128, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122aa8090113b9d1c1b31ce61863aaf5db52">wxSOCKET_NOWAIT_WRITE</a> = 256, 
<br/>
&#160;&#160;<a class="el" href="socket_8h.html#a1fb9092bcdeada2d206bdc74afbbe122aaa40cccf6be9104f8287491e5f4b93e1">wxSOCKET_WAITALL_WRITE</a> = 512
<br/>
 }</td></tr>
<tr class="separator:a1fb9092bcdeada2d206bdc74afbbe122"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="aa6e1c1635ef97512c7a0d0c0c7a5db31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="socket_8h.html#aa6e1c1635ef97512c7a0d0c0c7a5db31">wxSOCKET_T</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The type of the native socket. </p>
<p>Notice that the definition below is simplified and this type is not always int, e.g. it is a 64 bit integer type under Win64.</p>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="anchor" id="wxSocketFlags"></a> wxSocket Flags.</p>
<p>A brief overview on how to use these flags follows.</p>
<p>If no flag is specified (this is the same as <b>wxSOCKET_NONE</b>), IO calls will return after some data has been read or written, even when the transfer might not be complete. This is the same as issuing exactly one blocking low-level call to <b>recv()</b> or <b>send()</b>. Note that <em>blocking</em> here refers to when the function returns, not to whether the GUI blocks during this time.</p>
<p>If <b>wxSOCKET_NOWAIT</b> is specified, IO calls will return immediately. Read operations will retrieve only available data. Write operations will write as much data as possible, depending on how much space is available in the output buffer. This is the same as issuing exactly one nonblocking low-level call to <b>recv()</b> or <b>send()</b>. Note that <em>nonblocking</em> here refers to when the function returns, not to whether the GUI blocks during this time. Also note that this flag impacts both Read and Write operations. If it is desired to control Read independently of Write, for example you want no wait on Read(), but you do want to wait on Write(), then use wxSOCKET_NOWAIT_READ and wxSOCKET_NOWAIT_WRITE.</p>
<p>If <b>wxSOCKET_NOWAIT_READ</b> (this flag is new since wxWidgets 2.9.5) is specified, Read operations will return immediately. Read operations will retrieve only available data. This is the same as issuing exactly one nonblocking low-level call to <b>recv()</b>. Note that <em>nonblocking</em> here refers to when the function returns, not to whether the GUI blocks during this time. This flag should not be enabled if ReadMsg() is going to be used (it will be ignored), if you do then thread-safety may be at risk. Note that wxSOCKET_NOWAIT_READ impacts only Read operations and does not impact Write operations, allowing Read and Write operations to be set differently.</p>
<p>If <b>wxSOCKET_NOWAIT_WRITE</b> (this flag is new since wxWidgets 2.9.5) is specified, Write operations will return immediately. Write operations will write as much data as possible, depending on how much space is available in the output buffer. This is the same as issuing exactly one nonblocking low-level call to <b>send()</b>. Note that <em>nonblocking</em> here refers to when the function returns, not to whether the GUI blocks during this time. This flag should not be enabled if WriteMsg() is going to be used (it will be ignored), if you use it then thread safety may be at risk. Note that wxSOCKET_NOWAIT_WRITE impacts only Write operations and does not impact Write operations, allowing Read and Write operations to be set differently.</p>
<p>If <b>wxSOCKET_WAITALL</b> is specified, IO calls won't return until ALL the data has been read or written (or until an error occurs), blocking if necessary, and issuing several low level calls if necessary. This is the same as having a loop which makes as many blocking low-level calls to <b>recv()</b> or <b>send()</b> as needed so as to transfer all the data. Note that <em>blocking</em> here refers to when the function returns, not to whether the GUI blocks during this time. Note that wxSOCKET_WAITALL impacts both Read and Write operations. If you desire to wait for all on just Read operations, but not on Write operations, (or vice versa), use wxSOCKET_WAITALL_READ or wxSOCKET_WAITALL_WRITE.</p>
<p>If <b>wxSOCKET_WAITALL_READ</b> (this flag is new since wxWidgets 2.9.5) is specified, Read operations won't return until ALL the data has been read (or until an error occurs), blocking if necessary, and issuing several low level calls if necessary. This is the same as having a loop which makes as many blocking low-level calls to <b>recv()</b> as needed so as to transfer all the data. Note that <em>blocking</em> here refers to when the function returns, not to whether the GUI blocks during this time. Note that wxSOCKET_WAITALL_READ only has an impact on Read operations, and has no impact on Write operations, allowing Read and Write operations to have different settings.</p>
<p>If <b>wxSOCKET_WAITALL_WRITE</b> (this flag is new since wxWidgets 2.9.5) is specified, Write() and WriteMsg() calls won't return until ALL the data has been written (or until an error occurs), blocking if necessary, and issuing several low level calls if necessary. This is the same as having a loop which makes as many blocking low-level calls to <b>send()</b> as needed so as to transfer all the data. Note that <em>blocking</em> here refers to when the function returns, not to whether the GUI blocks during this time. Note that wxSOCKET_WAITALL_WRITE only has an impact on Write operations, and has no impact on Read operations, allowing Read and Write operations to have different settings.</p>
<p>The <b>wxSOCKET_BLOCK</b> flag controls whether the GUI blocks during IO operations. If this flag is specified, the socket will not yield during IO calls, so the GUI will remain blocked until the operation completes. If it is not used, then the application must take extra care to avoid unwanted reentrance.</p>
<p>The <b>wxSOCKET_REUSEADDR</b> flag controls the use of the <b>SO_REUSEADDR</b> standard <b>setsockopt()</b> flag. This flag allows the socket to bind to a port that is already in use. This is mostly used on UNIX-based systems to allow rapid starting and stopping of a server, otherwise you may have to wait several minutes for the port to become available.</p>
<p><b>wxSOCKET_REUSEADDR</b> can also be used with socket clients to (re)bind to a particular local port for an outgoing connection. This option can have surprising platform dependent behaviour, so check the documentation for your platform's implementation of setsockopt().</p>
<p>Note that on BSD-based systems(e.g. Mac OS X), use of <b>wxSOCKET_REUSEADDR</b> implies <b>SO_REUSEPORT</b> in addition to <b>SO_REUSEADDR</b> to be consistent with Windows.</p>
<p>The <b>wxSOCKET_BROADCAST</b> flag controls the use of the <b>SO_BROADCAST</b> standard <b>setsockopt()</b> flag. This flag allows the socket to use the broadcast address, and is generally used in conjunction with <b>wxSOCKET_NOBIND</b> and <a class="el" href="classwx_i_paddress.html#a84d58d990e0931616c6842ce103e2000" title="Internally, this is the same as setting the IP address to INADDR_BROADCAST.">wxIPaddress::BroadcastAddress()</a>.</p>
<p>So:</p>
<ul>
<li><b>wxSOCKET_NONE</b> will try to read at least SOME data, no matter how much.</li>
<li><b>wxSOCKET_NOWAIT</b> will always return immediately, even if it cannot read or write ANY data.</li>
<li><b>wxSOCKET_WAITALL</b> will only return when it has read or written ALL the data.</li>
<li><b>wxSOCKET_BLOCK</b> has nothing to do with the previous flags and it controls whether the GUI blocks.</li>
<li><b>wxSOCKET_REUSEADDR</b> controls special platform-specific behaviour for reusing local addresses/ports. </li>
</ul>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122aeb1d7a7c69cad4340559486c04d2336c"></a>wxSOCKET_NONE</em>&nbsp;</td><td>
<p>Normal functionality. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122af929a3050e69ff9d3a2dd93795ba2273"></a>wxSOCKET_NOWAIT</em>&nbsp;</td><td>
<p>Read/write as much data as possible and return immediately. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122aea93cf511bb913dfc17571dd29a2de22"></a>wxSOCKET_WAITALL</em>&nbsp;</td><td>
<p>Wait for all required data to be read/written unless an error occurs. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122a5736b2f6fb724b2082d861e5a87e1547"></a>wxSOCKET_BLOCK</em>&nbsp;</td><td>
<p>Block the GUI (do not yield) while reading/writing data. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122a181fcaf757a6eb4e219a4c9cd473663b"></a>wxSOCKET_REUSEADDR</em>&nbsp;</td><td>
<p>Allows the use of an in-use port. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122a680d618e39c20b6003bb99d1f0a3443f"></a>wxSOCKET_BROADCAST</em>&nbsp;</td><td>
<p>Switches the socket to broadcast mode. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122a2e119a9b0fa2926953a941ff6421e886"></a>wxSOCKET_NOBIND</em>&nbsp;</td><td>
<p>Stops the socket from being bound to a specific adapter (normally used in conjunction with <b>wxSOCKET_BROADCAST</b>) </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122a0fa0e48f2069e4b6bd09eb3f1e0b7624"></a>wxSOCKET_NOWAIT_READ</em>&nbsp;</td><td>
<p>Read as much data as possible and return immediately. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122a9a6420537512593d795a52cf7efa320a"></a>wxSOCKET_WAITALL_READ</em>&nbsp;</td><td>
<p>Wait for all required data to be read unless an error occurs. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122aa8090113b9d1c1b31ce61863aaf5db52"></a>wxSOCKET_NOWAIT_WRITE</em>&nbsp;</td><td>
<p>Write as much data as possible and return immediately. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a1fb9092bcdeada2d206bdc74afbbe122aaa40cccf6be9104f8287491e5f4b93e1"></a>wxSOCKET_WAITALL_WRITE</em>&nbsp;</td><td>
<p>Wait for all required data to be written unless an error occurs. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="socket_8h.html#aec4f3fb4ed18dd9b1fe503750ec4e0f6">wxSocketError</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>wxSocket error return values. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6aea08ec67172043a54c3a5097d55a0a7d"></a>wxSOCKET_NOERROR</em>&nbsp;</td><td>
<p>No error happened. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6a82ac229a005d26a17cb3454a87fc1c63"></a>wxSOCKET_INVOP</em>&nbsp;</td><td>
<p>Invalid operation. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6aa5bb62f3f65253b53347af737387c308"></a>wxSOCKET_IOERR</em>&nbsp;</td><td>
<p>Input/Output error. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6a371126a5aaeec800ac35d787ba0139ea"></a>wxSOCKET_INVADDR</em>&nbsp;</td><td>
<p>Invalid address passed to wxSocket. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6ab67395476ae45e701919ab3294e6183b"></a>wxSOCKET_INVSOCK</em>&nbsp;</td><td>
<p>Invalid socket (uninitialized). </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6a27669eab5e472abebdebecf0face6ad4"></a>wxSOCKET_NOHOST</em>&nbsp;</td><td>
<p>No corresponding host. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6a3602281da68a004305231d967575a5cc"></a>wxSOCKET_INVPORT</em>&nbsp;</td><td>
<p>Invalid port. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6a4682fd14b73a9ad5837321a8f243a146"></a>wxSOCKET_WOULDBLOCK</em>&nbsp;</td><td>
<p>The socket is non-blocking and the operation would block. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6a0f75c06fbe178112f4f79e6f4ce516f5"></a>wxSOCKET_TIMEDOUT</em>&nbsp;</td><td>
<p>The timeout for this operation expired. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="aec4f3fb4ed18dd9b1fe503750ec4e0f6ac5f92c61c05bcb7c0e12b020b4dd6cc0"></a>wxSOCKET_MEMERR</em>&nbsp;</td><td>
<p>Memory exhausted. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<a class="anchor" id="a2ec8996eecae7da1c5fa77c88a45a353"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="socket_8h.html#a2ec8996eecae7da1c5fa77c88a45a353">wxSocketEventFlags</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="anchor" id="wxSocketEventFlags"></a> wxSocket Event Flags.</p>
<p>A brief note on how to use these events:</p>
<p>The <b>wxSOCKET_INPUT</b> event will be issued whenever there is data available for reading. This will be the case if the input queue was empty and new data arrives, or if the application has read some data yet there is still more data available. This means that the application does not need to read all available data in response to a <b>wxSOCKET_INPUT</b> event, as more events will be produced as necessary.</p>
<p>The <b>wxSOCKET_OUTPUT</b> event is issued when a socket is first connected with Connect() or accepted with Accept(). After that, new events will be generated only after an output operation fails with <b>wxSOCKET_WOULDBLOCK</b> and buffer space becomes available again. This means that the application should assume that it can write data to the socket until an <b>wxSOCKET_WOULDBLOCK</b> error occurs; after this, whenever the socket becomes writable again the application will be notified with another <b>wxSOCKET_OUTPUT</b> event.</p>
<p>The <b>wxSOCKET_CONNECTION</b> event is issued when a delayed connection request completes successfully (client) or when a new connection arrives at the incoming queue (server).</p>
<p>The <b>wxSOCKET_LOST</b> event is issued when a close indication is received for the socket. This means that the connection broke down or that it was closed by the peer. Also, this event will be issued if a connection request fails. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a2ec8996eecae7da1c5fa77c88a45a353a27d14981defd0cb66f76ec733c7c6ff1"></a>wxSOCKET_INPUT</em>&nbsp;</td><td>
<p>There is data available for reading. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2ec8996eecae7da1c5fa77c88a45a353a8a57cbc400a829a53c64f92950a9e6f6"></a>wxSOCKET_OUTPUT</em>&nbsp;</td><td>
<p>The socket is ready to be written to. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2ec8996eecae7da1c5fa77c88a45a353ad5face6ce3a941b3b8bb08971bd6f3fc"></a>wxSOCKET_CONNECTION</em>&nbsp;</td><td>
<p>Incoming connection request (server), or successful connection establishment (client). </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a2ec8996eecae7da1c5fa77c88a45a353a9f962bb5acef5cc744995e2fca0ac165"></a>wxSOCKET_LOST</em>&nbsp;</td><td>
<p>The connection has been closed. </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
</div><!-- contents -->

<address class="footer">
	<small>
		Generated on Thu Nov 27 2014 13:46:41 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
	</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>