summaryrefslogtreecommitdiff
path: root/h1z1/libghack/CSFML-2.1-windows-64bits/CSFML-2.1/doc/html/UdpSocket_8h_source.htm
blob: a8e7db744d689be81cfc27f2815a4c19e454e64a (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
<!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="headertitle">
<div class="title">UdpSocket.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="UdpSocket_8h.htm">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// SFML - Simple and Fast Multimedia Library</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef SFML_UDPSOCKET_H</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define SFML_UDPSOCKET_H</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;<a class="code" href="Network_2Export_8h.htm">SFML/Network/Export.h</a>&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="IpAddress_8h.htm">SFML/Network/IpAddress.h</a>&gt;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="SocketStatus_8h.htm">SFML/Network/SocketStatus.h</a>&gt;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="Network_2Types_8h.htm">SFML/Network/Types.h</a>&gt;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* <a class="code" href="UdpSocket_8h.htm#af649392c41ece776fd7ec56217639615" title="Create a new UDP socket.">sfUdpSocket_create</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <span class="keywordtype">void</span> <a class="code" href="UdpSocket_8h.htm#afac1437f83c9a385a3f43db52aa9234d" title="Destroy a UDP socket.">sfUdpSocket_destroy</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <span class="keywordtype">void</span> <a class="code" href="UdpSocket_8h.htm#ad7afb7be44883236277629efe74ddb44" title="Set the blocking state of a UDP listener.">sfUdpSocket_setBlocking</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket, <a class="code" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a> blocking);</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="Config_8h.htm#a7559f07a31bb3a4a3d865178ce4dc70b">sfBool</a> <a class="code" href="UdpSocket_8h.htm#ad3cb760bad25d3aa38c23e0f22ff49cf" title="Tell whether a UDP socket is in blocking or non-blocking mode.">sfUdpSocket_isBlocking</a>(<span class="keyword">const</span> <a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="UdpSocket_8h.htm#ae343b0527f28b4ccb70c1e959a84ba76" title="Get the port to which a UDP socket is bound locally.">sfUdpSocket_getLocalPort</a>(<span class="keyword">const</span> <a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket);</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa" title="Define the status that can be returned by the socket functions.">sfSocketStatus</a> <a class="code" href="UdpSocket_8h.htm#a277b0694d66511783f9907975793dae6" title="Bind a UDP socket to a specific port.">sfUdpSocket_bind</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port);</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <span class="keywordtype">void</span> <a class="code" href="UdpSocket_8h.htm#a800776e415ce2705d0b9a71736d4d71c" title="Unbind a UDP socket from the local port to which it is bound.">sfUdpSocket_unbind</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa" title="Define the status that can be returned by the socket functions.">sfSocketStatus</a> <a class="code" href="UdpSocket_8h.htm#ac31401cdf413cbe5fde7d8d2e2a2dadc" title="Send raw data to a remote peer with a UDP socket.">sfUdpSocket_send</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket, <span class="keyword">const</span> <span class="keywordtype">void</span>* data, <span class="keywordtype">size_t</span> size, <a class="code" href="structsfIpAddress.htm" title="Encapsulate an IPv4 network address.">sfIpAddress</a> address, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa" title="Define the status that can be returned by the socket functions.">sfSocketStatus</a> <a class="code" href="UdpSocket_8h.htm#a80106b3d8ad72364b2774fecdcaf8553" title="Receive raw data from a remote peer with a UDP socket.">sfUdpSocket_receive</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket, <span class="keywordtype">void</span>* data, <span class="keywordtype">size_t</span> maxSize, <span class="keywordtype">size_t</span>* sizeReceived, <a class="code" href="structsfIpAddress.htm" title="Encapsulate an IPv4 network address.">sfIpAddress</a>* address, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>* port);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa" title="Define the status that can be returned by the socket functions.">sfSocketStatus</a> <a class="code" href="UdpSocket_8h.htm#a396b459d2c7c555998faa3b349f12aa4" title="Send a formatted packet of data to a remote peer with a UDP socket.">sfUdpSocket_sendPacket</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket, <a class="code" href="Network_2Types_8h.htm#a2a26ce53a9a6b6ab78807fd31aa32815">sfPacket</a>* packet, <a class="code" href="structsfIpAddress.htm" title="Encapsulate an IPv4 network address.">sfIpAddress</a> address, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <a class="code" href="SocketStatus_8h.htm#a7ea6036375503daef59eb4cb38ccdcaa" title="Define the status that can be returned by the socket functions.">sfSocketStatus</a> <a class="code" href="UdpSocket_8h.htm#a71868a2da0677442bf9366182a0ea8b4" title="Receive a formatted packet of data from a remote peer with a UDP socket.">sfUdpSocket_receivePacket</a>(<a class="code" href="Network_2Types_8h.htm#ae433fd1f2b3e8fb2c8d2f485d1e785f1">sfUdpSocket</a>* socket, <a class="code" href="Network_2Types_8h.htm#a2a26ce53a9a6b6ab78807fd31aa32815">sfPacket</a>* packet, <a class="code" href="structsfIpAddress.htm" title="Encapsulate an IPv4 network address.">sfIpAddress</a>* address, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>* port);</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<a class="code" href="Network_2Export_8h.htm#a957428faa4fd4d577529c669fedd3014">CSFML_NETWORK_API</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="UdpSocket_8h.htm#a68b62f968f64978bf08d64421af81c28" title="Return the maximum number of bytes that can be sent in a single UDP datagram.">sfUdpSocket_maxDatagramSize</a>();</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;<span class="preprocessor">#endif // SFML_UDPSOCKET_H</span></div>
</div><!-- fragment --></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>