summaryrefslogtreecommitdiff
path: root/libghack/CSFML-2.1-windows-64bits/CSFML-2.1/doc/html/UdpSocket_8h.htm
blob: 751a54c30bdcb71153fe4a075da3c45332e49991 (plain)
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
<!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>
        <title>CSFML - C binding of the Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
        <!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">CSFML</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.htm"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.htm"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.htm"><span>File&#160;List</span></a></li>
      <li><a href="globals.htm"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6a66b7969672f1da69f458a57d2c97f9.htm">include</a></li><li class="navelem"><a class="el" href="dir_8cc999c03ab8fdf40558b1f21f869c3e.htm">SFML</a></li><li class="navelem"><a class="el" href="dir_33b8fa607ba222d3f5ced3f03c94935c.htm">Network</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">UdpSocket.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="Network_2Export_8h_source.htm">SFML/Network/Export.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="IpAddress_8h_source.htm">SFML/Network/IpAddress.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="SocketStatus_8h_source.htm">SFML/Network/SocketStatus.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="Network_2Types_8h_source.htm">SFML/Network/Types.h</a>&gt;</code><br/>
<code>#include &lt;stddef.h&gt;</code><br/>
</div>
<p><a href="UdpSocket_8h_source.htm">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af649392c41ece776fd7ec56217639615"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#af649392c41ece776fd7ec56217639615">sfUdpSocket_create</a> (void)</td></tr>
<tr class="memdesc:af649392c41ece776fd7ec56217639615"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new UDP socket.  <a href="#af649392c41ece776fd7ec56217639615"></a><br/></td></tr>
<tr class="separator:af649392c41ece776fd7ec56217639615"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afac1437f83c9a385a3f43db52aa9234d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#afac1437f83c9a385a3f43db52aa9234d">sfUdpSocket_destroy</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket)</td></tr>
<tr class="memdesc:afac1437f83c9a385a3f43db52aa9234d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a UDP socket.  <a href="#afac1437f83c9a385a3f43db52aa9234d"></a><br/></td></tr>
<tr class="separator:afac1437f83c9a385a3f43db52aa9234d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7afb7be44883236277629efe74ddb44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#ad7afb7be44883236277629efe74ddb44">sfUdpSocket_setBlocking</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket, <a class="el" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a> blocking)</td></tr>
<tr class="memdesc:ad7afb7be44883236277629efe74ddb44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the blocking state of a UDP listener.  <a href="#ad7afb7be44883236277629efe74ddb44"></a><br/></td></tr>
<tr class="separator:ad7afb7be44883236277629efe74ddb44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3cb760bad25d3aa38c23e0f22ff49cf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#ad3cb760bad25d3aa38c23e0f22ff49cf">sfUdpSocket_isBlocking</a> (const <a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket)</td></tr>
<tr class="memdesc:ad3cb760bad25d3aa38c23e0f22ff49cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell whether a UDP socket is in blocking or non-blocking mode.  <a href="#ad3cb760bad25d3aa38c23e0f22ff49cf"></a><br/></td></tr>
<tr class="separator:ad3cb760bad25d3aa38c23e0f22ff49cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae343b0527f28b4ccb70c1e959a84ba76"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> unsigned short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#ae343b0527f28b4ccb70c1e959a84ba76">sfUdpSocket_getLocalPort</a> (const <a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket)</td></tr>
<tr class="memdesc:ae343b0527f28b4ccb70c1e959a84ba76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the port to which a UDP socket is bound locally.  <a href="#ae343b0527f28b4ccb70c1e959a84ba76"></a><br/></td></tr>
<tr class="separator:ae343b0527f28b4ccb70c1e959a84ba76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a277b0694d66511783f9907975793dae6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#a277b0694d66511783f9907975793dae6">sfUdpSocket_bind</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket, unsigned short port)</td></tr>
<tr class="memdesc:a277b0694d66511783f9907975793dae6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bind a UDP socket to a specific port.  <a href="#a277b0694d66511783f9907975793dae6"></a><br/></td></tr>
<tr class="separator:a277b0694d66511783f9907975793dae6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a800776e415ce2705d0b9a71736d4d71c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#a800776e415ce2705d0b9a71736d4d71c">sfUdpSocket_unbind</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket)</td></tr>
<tr class="memdesc:a800776e415ce2705d0b9a71736d4d71c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unbind a UDP socket from the local port to which it is bound.  <a href="#a800776e415ce2705d0b9a71736d4d71c"></a><br/></td></tr>
<tr class="separator:a800776e415ce2705d0b9a71736d4d71c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac31401cdf413cbe5fde7d8d2e2a2dadc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#ac31401cdf413cbe5fde7d8d2e2a2dadc">sfUdpSocket_send</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket, const void *data, size_t size, <a class="el" href="structsfIpAddress.htm">sfIpAddress</a> address, unsigned short port)</td></tr>
<tr class="memdesc:ac31401cdf413cbe5fde7d8d2e2a2dadc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send raw data to a remote peer with a UDP socket.  <a href="#ac31401cdf413cbe5fde7d8d2e2a2dadc"></a><br/></td></tr>
<tr class="separator:ac31401cdf413cbe5fde7d8d2e2a2dadc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80106b3d8ad72364b2774fecdcaf8553"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#a80106b3d8ad72364b2774fecdcaf8553">sfUdpSocket_receive</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket, void *data, size_t maxSize, size_t *sizeReceived, <a class="el" href="structsfIpAddress.htm">sfIpAddress</a> *address, unsigned short *port)</td></tr>
<tr class="memdesc:a80106b3d8ad72364b2774fecdcaf8553"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive raw data from a remote peer with a UDP socket.  <a href="#a80106b3d8ad72364b2774fecdcaf8553"></a><br/></td></tr>
<tr class="separator:a80106b3d8ad72364b2774fecdcaf8553"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a396b459d2c7c555998faa3b349f12aa4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#a396b459d2c7c555998faa3b349f12aa4">sfUdpSocket_sendPacket</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket, <a class="el" href="Network_2Types_8h.htm#a2a26ce53a9a6b6ab78807fd31aa32815">sfPacket</a> *packet, <a class="el" href="structsfIpAddress.htm">sfIpAddress</a> address, unsigned short port)</td></tr>
<tr class="memdesc:a396b459d2c7c555998faa3b349f12aa4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a formatted packet of data to a remote peer with a UDP socket.  <a href="#a396b459d2c7c555998faa3b349f12aa4"></a><br/></td></tr>
<tr class="separator:a396b459d2c7c555998faa3b349f12aa4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71868a2da0677442bf9366182a0ea8b4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#a71868a2da0677442bf9366182a0ea8b4">sfUdpSocket_receivePacket</a> (<a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *socket, <a class="el" href="Network_2Types_8h.htm#a2a26ce53a9a6b6ab78807fd31aa32815">sfPacket</a> *packet, <a class="el" href="structsfIpAddress.htm">sfIpAddress</a> *address, unsigned short *port)</td></tr>
<tr class="memdesc:a71868a2da0677442bf9366182a0ea8b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive a formatted packet of data from a remote peer with a UDP socket.  <a href="#a71868a2da0677442bf9366182a0ea8b4"></a><br/></td></tr>
<tr class="separator:a71868a2da0677442bf9366182a0ea8b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68b62f968f64978bf08d64421af81c28"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="UdpSocket_8h.htm#a68b62f968f64978bf08d64421af81c28">sfUdpSocket_maxDatagramSize</a> ()</td></tr>
<tr class="memdesc:a68b62f968f64978bf08d64421af81c28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the maximum number of bytes that can be sent in a single UDP datagram.  <a href="#a68b62f968f64978bf08d64421af81c28"></a><br/></td></tr>
<tr class="separator:a68b62f968f64978bf08d64421af81c28"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a277b0694d66511783f9907975793dae6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a> sfUdpSocket_bind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind a UDP socket to a specific port. </p>
<p>Binding the socket to a port is necessary for being able to receive data on that port. You can use the special value 0 to tell the system to automatically pick an available port, and then call sfUdpSocket_getLocalPort to retrieve the chosen port.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object </td></tr>
    <tr><td class="paramname">port</td><td>Port to bind the socket to</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status code </dd></dl>

</div>
</div>
<a class="anchor" id="af649392c41ece776fd7ec56217639615"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* sfUdpSocket_create </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new UDP socket. </p>
<dl class="section return"><dt>Returns</dt><dd>A new sfUdpSocket object </dd></dl>

</div>
</div>
<a class="anchor" id="afac1437f83c9a385a3f43db52aa9234d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> void sfUdpSocket_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a UDP socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket to destroy </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae343b0527f28b4ccb70c1e959a84ba76"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> unsigned short sfUdpSocket_getLocalPort </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the port to which a UDP socket is bound locally. </p>
<p>If the socket is not bound to a port, this function returns 0.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Port to which the socket is bound </dd></dl>

</div>
</div>
<a class="anchor" id="ad3cb760bad25d3aa38c23e0f22ff49cf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a> sfUdpSocket_isBlocking </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tell whether a UDP socket is in blocking or non-blocking mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>sfTrue if the socket is blocking, sfFalse otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a68b62f968f64978bf08d64421af81c28"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> unsigned int sfUdpSocket_maxDatagramSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the maximum number of bytes that can be sent in a single UDP datagram. </p>
<dl class="section return"><dt>Returns</dt><dd>The maximum size of a UDP datagram (message) </dd></dl>

</div>
</div>
<a class="anchor" id="a80106b3d8ad72364b2774fecdcaf8553"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a> sfUdpSocket_receive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>maxSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>sizeReceived</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsfIpAddress.htm">sfIpAddress</a> *&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short *&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receive raw data from a remote peer with a UDP socket. </p>
<p>In blocking mode, this function will wait until some bytes are actually received. Be careful to use a buffer which is large enough for the data that you intend to receive, if it is too small then an error will be returned and <em>all</em> the data will be lost.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object </td></tr>
    <tr><td class="paramname">data</td><td>Pointer to the array to fill with the received bytes </td></tr>
    <tr><td class="paramname">size</td><td>Maximum number of bytes that can be received </td></tr>
    <tr><td class="paramname">received</td><td>This variable is filled with the actual number of bytes received </td></tr>
    <tr><td class="paramname">remoteAddress</td><td>Address of the peer that sent the data </td></tr>
    <tr><td class="paramname">remotePort</td><td>Port of the peer that sent the data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status code </dd></dl>

</div>
</div>
<a class="anchor" id="a71868a2da0677442bf9366182a0ea8b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a> sfUdpSocket_receivePacket </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#a2a26ce53a9a6b6ab78807fd31aa32815">sfPacket</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsfIpAddress.htm">sfIpAddress</a> *&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short *&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receive a formatted packet of data from a remote peer with a UDP socket. </p>
<p>In blocking mode, this function will wait until the whole packet has been received.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>Packet to fill with the received data </td></tr>
    <tr><td class="paramname">remoteAddress</td><td>Address of the peer that sent the data </td></tr>
    <tr><td class="paramname">remotePort</td><td>Port of the peer that sent the data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status code </dd></dl>

</div>
</div>
<a class="anchor" id="ac31401cdf413cbe5fde7d8d2e2a2dadc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a> sfUdpSocket_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsfIpAddress.htm">sfIpAddress</a>&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send raw data to a remote peer with a UDP socket. </p>
<p>Make sure that <em>size</em> is not greater than <a class="el" href="UdpSocket_8h.htm#a68b62f968f64978bf08d64421af81c28" title="Return the maximum number of bytes that can be sent in a single UDP datagram.">sfUdpSocket_maxDatagramSize()</a>, otherwise this function will fail and no data will be sent.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object </td></tr>
    <tr><td class="paramname">data</td><td>Pointer to the sequence of bytes to send </td></tr>
    <tr><td class="paramname">size</td><td>Number of bytes to send </td></tr>
    <tr><td class="paramname">remoteAddress</td><td>Address of the receiver </td></tr>
    <tr><td class="paramname">remotePort</td><td>Port of the receiver to send the data to</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status code </dd></dl>

</div>
</div>
<a class="anchor" id="a396b459d2c7c555998faa3b349f12aa4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="el" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa">sfSocketStatus</a> sfUdpSocket_sendPacket </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#a2a26ce53a9a6b6ab78807fd31aa32815">sfPacket</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structsfIpAddress.htm">sfIpAddress</a>&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send a formatted packet of data to a remote peer with a UDP socket. </p>
<p>Make sure that the packet size is not greater than <a class="el" href="UdpSocket_8h.htm#a68b62f968f64978bf08d64421af81c28" title="Return the maximum number of bytes that can be sent in a single UDP datagram.">sfUdpSocket_maxDatagramSize()</a>, otherwise this function will fail and no data will be sent.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object </td></tr>
    <tr><td class="paramname">packet</td><td>Packet to send </td></tr>
    <tr><td class="paramname">remoteAddress</td><td>Address of the receiver </td></tr>
    <tr><td class="paramname">remotePort</td><td>Port of the receiver to send the data to</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status code </dd></dl>

</div>
</div>
<a class="anchor" id="ad7afb7be44883236277629efe74ddb44"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> void sfUdpSocket_setBlocking </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a>&#160;</td>
          <td class="paramname"><em>blocking</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the blocking state of a UDP listener. </p>
<p>In blocking mode, calls will not return until they have completed their task. For example, a call to sfUDPSocket_receive in blocking mode won't return until new data was actually received. In non-blocking mode, calls will always return immediately, using the return code to signal whether there was data available or not. By default, all sockets are blocking.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object </td></tr>
    <tr><td class="paramname">blocking</td><td>sfTrue to set the socket as blocking, sfFalse for non-blocking </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a800776e415ce2705d0b9a71736d4d71c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> void sfUdpSocket_unbind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a> *&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unbind a UDP socket from the local port to which it is bound. </p>
<p>The port that the socket was previously using is immediately available after this function is called. If the socket is not bound to a port, this function has no effect.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>UDP socket object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                Copyright � Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>