aboutsummaryrefslogtreecommitdiff
path: root/doc/udp.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/udp.html')
-rw-r--r--doc/udp.html94
1 files changed, 47 insertions, 47 deletions
diff --git a/doc/udp.html b/doc/udp.html
index 4618aad..db711cb 100644
--- a/doc/udp.html
+++ b/doc/udp.html
@@ -13,17 +13,17 @@
13 13
14<!-- header ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 14<!-- header ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
15 15
16<div class=header> 16<div class="header">
17<hr> 17<hr>
18<center> 18<center>
19<table summary="LuaSocket logo"> 19<table summary="LuaSocket logo">
20<tr><td align=center><a href="http://www.lua.org"> 20<tr><td align="center"><a href="http://www.lua.org">
21<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png"> 21<img width="128" height="128" border="0" alt="LuaSocket" src="luasocket.png">
22</a></td></tr> 22</a></td></tr>
23<tr><td align=center valign=top>Network support for the Lua language 23<tr><td align="center" valign="top">Network support for the Lua language
24</td></tr> 24</td></tr>
25</table> 25</table>
26<p class=bar> 26<p class="bar">
27<a href="index.html">home</a> &middot; 27<a href="index.html">home</a> &middot;
28<a href="index.html#download">download</a> &middot; 28<a href="index.html#download">download</a> &middot;
29<a href="installation.html">installation</a> &middot; 29<a href="installation.html">installation</a> &middot;
@@ -71,26 +71,26 @@ unconnected:<b>getoption()</b>
71 71
72<p class="description"> 72<p class="description">
73Gets an option value from the UDP object. 73Gets an option value from the UDP object.
74See <a href=#setoption><tt>setoption</tt></a> for 74See <a href="#setoption"><tt>setoption</tt></a> for
75description of the option names and values. 75description of the option names and values.
76</p> 76</p>
77 77
78<p class="parameters"><tt>Option</tt> is a string with the option name. 78<p class="parameters"><tt>Option</tt> is a string with the option name.
79<ul> 79<ul>
80<li> '<tt>dontroute</tt>' 80<li> '<tt>dontroute</tt>'</li>
81<li> '<tt>broadcast</tt>' 81<li> '<tt>broadcast</tt>'</li>
82<li> '<tt>reuseaddr</tt>' 82<li> '<tt>reuseaddr</tt>'</li>
83<li> '<tt>reuseport</tt>' 83<li> '<tt>reuseport</tt>'</li>
84<li> '<tt>ip-multicast-loop</tt>' 84<li> '<tt>ip-multicast-loop</tt>'</li>
85<li> '<tt>ipv6-v6only</tt>' 85<li> '<tt>ipv6-v6only</tt>'</li>
86<li> '<tt>ip-multicast-if</tt>' 86<li> '<tt>ip-multicast-if</tt>'</li>
87<li> '<tt>ip-multicast-ttl</tt>' 87<li> '<tt>ip-multicast-ttl</tt>'</li>
88<li> '<tt>ip-add-membership</tt>' 88<li> '<tt>ip-add-membership</tt>'</li>
89<li> '<tt>ip-drop-membership</tt>' 89<li> '<tt>ip-drop-membership</tt>'</li>
90</ul> 90</ul>
91</p> 91</p>
92 92
93<p class=return> 93<p class="return">
94The method returns the option <tt>value</tt> in case of 94The method returns the option <tt>value</tt> in case of
95success, or 95success, or
96<b><tt>nil</tt></b> followed by an error message otherwise. 96<b><tt>nil</tt></b> followed by an error message otherwise.
@@ -108,7 +108,7 @@ associated with a connected UDP object.
108</p> 108</p>
109 109
110 110
111<p class=return> 111<p class="return">
112Returns a string with the IP address of the peer, the 112Returns a string with the IP address of the peer, the
113port number that peer is using for the connection, 113port number that peer is using for the connection,
114and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>"). 114and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
@@ -131,7 +131,7 @@ Returns the local address information associated to the object.
131</p> 131</p>
132 132
133 133
134<p class=return> 134<p class="return">
135The method returns a string with local IP address, a number with 135The method returns a string with local IP address, a number with
136the local port, 136the local port,
137and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>"). 137and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
@@ -148,12 +148,12 @@ wild-card address).
148 148
149<!-- gettimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 149<!-- gettimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
150 150
151<p class=name id="gettimeout"> 151<p class="name" id="gettimeout">
152connected:<b>settimeout(</b>value<b>)</b><br> 152connected:<b>settimeout(</b>value<b>)</b><br>
153unconnected:<b>settimeout(</b>value<b>)</b> 153unconnected:<b>settimeout(</b>value<b>)</b>
154</p> 154</p>
155 155
156<p class=description> 156<p class="description">
157Returns the current timeout value. 157Returns the current timeout value.
158</p> 158</p>
159 159
@@ -180,8 +180,8 @@ the excess bytes are discarded. If there are less then
180<tt>size</tt> bytes available in the current datagram, the 180<tt>size</tt> bytes available in the current datagram, the
181available bytes are returned. 181available bytes are returned.
182If <tt>size</tt> is omitted, the 182If <tt>size</tt> is omitted, the
183compile-time constant <a 183compile-time constant <a href="socket.html#datagramsize">
184href=socket.html#datagramsize><tt>socket._DATAGRAMSIZE</tt></a> is used 184<tt>socket._DATAGRAMSIZE</tt></a> is used
185(it defaults to 8192 bytes). Larger sizes will cause a 185(it defaults to 8192 bytes). Larger sizes will cause a
186temporary buffer to be allocated for the operation. 186temporary buffer to be allocated for the operation.
187</p> 187</p>
@@ -286,45 +286,45 @@ name, and <tt>value</tt> depends on the option being set:
286<ul> 286<ul>
287<li> '<tt>dontroute</tt>': Indicates that outgoing 287<li> '<tt>dontroute</tt>': Indicates that outgoing
288messages should bypass the standard routing facilities. 288messages should bypass the standard routing facilities.
289Receives a boolean value; 289Receives a boolean value;</li>
290<li> '<tt>broadcast</tt>': Requests permission to send 290<li> '<tt>broadcast</tt>': Requests permission to send
291broadcast datagrams on the socket. 291broadcast datagrams on the socket.
292Receives a boolean value; 292Receives a boolean value;</li>
293<li> '<tt>reuseaddr</tt>': Indicates that the rules used in 293<li> '<tt>reuseaddr</tt>': Indicates that the rules used in
294validating addresses supplied in a <tt>bind()</tt> call 294validating addresses supplied in a <tt>bind()</tt> call
295should allow reuse of local addresses. 295should allow reuse of local addresses.
296Receives a boolean value; 296Receives a boolean value;</li>
297<li> '<tt>reuseport</tt>': Allows completely duplicate 297<li> '<tt>reuseport</tt>': Allows completely duplicate
298bindings by multiple processes if they all set 298bindings by multiple processes if they all set
299'<tt>reuseport</tt>' before binding the port. 299'<tt>reuseport</tt>' before binding the port.
300Receives a boolean value; 300Receives a boolean value;</li>
301<li> '<tt>ip-multicast-loop</tt>': 301<li> '<tt>ip-multicast-loop</tt>':
302Specifies whether or not a copy of an outgoing multicast 302Specifies whether or not a copy of an outgoing multicast
303datagram is delivered to the sending host as long as it is a 303datagram is delivered to the sending host as long as it is a
304member of the multicast group. 304member of the multicast group.
305Receives a boolean value; 305Receives a boolean value;</li>
306<li> '<tt>ipv6-v6only</tt>': 306<li> '<tt>ipv6-v6only</tt>':
307Specifies whether to restrict <tt>inet6</tt> sockets to 307Specifies whether to restrict <tt>inet6</tt> sockets to
308sending and receiving only IPv6 packets. 308sending and receiving only IPv6 packets.
309Receive a boolean value; 309Receive a boolean value;</li>
310<li> '<tt>ip-multicast-if</tt>': 310<li> '<tt>ip-multicast-if</tt>':
311Sets the interface over which outgoing multicast datagrams 311Sets the interface over which outgoing multicast datagrams
312are sent. 312are sent.
313Receives an IP address; 313Receives an IP address;</li>
314<li> '<tt>ip-multicast-ttl</tt>': 314<li> '<tt>ip-multicast-ttl</tt>':
315Sets the Time To Live in the IP header for outgoing 315Sets the Time To Live in the IP header for outgoing
316multicast datagrams. 316multicast datagrams.
317Receives a number; 317Receives a number;</li>
318<li> '<tt>ip-add-membership</tt>': 318<li> '<tt>ip-add-membership</tt>':
319Joins the multicast group specified. 319Joins the multicast group specified.
320Receives a table with fields 320Receives a table with fields
321<tt>multiaddr</tt> and <tt>interface</tt>, each containing an 321<tt>multiaddr</tt> and <tt>interface</tt>, each containing an
322IP address; 322IP address;</li>
323<li> '<tt>ip-drop-membership</tt>': Leaves the multicast 323<li> '<tt>ip-drop-membership</tt>': Leaves the multicast
324group specified. 324group specified.
325Receives a table with fields 325Receives a table with fields
326<tt>multiaddr</tt> and <tt>interface</tt>, each containing an 326<tt>multiaddr</tt> and <tt>interface</tt>, each containing an
327IP address. 327IP address.</li>
328</ul> 328</ul>
329 329
330<p class="return"> 330<p class="return">
@@ -332,7 +332,7 @@ The method returns 1 in case of success, or
332<b><tt>nil</tt></b> followed by an error message otherwise. 332<b><tt>nil</tt></b> followed by an error message otherwise.
333</p> 333</p>
334 334
335<p class=note> 335<p class="note">
336Note: The descriptions above come from the man pages. 336Note: The descriptions above come from the man pages.
337</p> 337</p>
338 338
@@ -381,11 +381,11 @@ is recommended when the same peer is used for several transmissions
381and can result in up to 30% performance gains. 381and can result in up to 30% performance gains.
382</p> 382</p>
383 383
384<p class=note> 384<p class="note">
385Note: Starting with LuaSocket 3.0, the host name resolution 385Note: Starting with LuaSocket 3.0, the host name resolution
386depends on whether the socket was created by <a 386depends on whether the socket was created by <a
387href=#socket.udp><tt>socket.udp</tt></a> or <a 387href="#socket.udp"><tt>socket.udp</tt></a> or <a
388href=#socket.udp6><tt>socket.udp6</tt></a>. Addresses from 388href="#socket.udp6"><tt>socket.udp6</tt></a>. Addresses from
389the appropriate family are tried in succession until the 389the appropriate family are tried in succession until the
390first success or until the last failure. 390first success or until the last failure.
391</p> 391</p>
@@ -492,23 +492,23 @@ returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
492an error message. 492an error message.
493</p> 493</p>
494 494
495<p class=note> 495<p class="note">
496Note: The choice between IPv4 and IPv6 happens during a call to 496Note: The choice between IPv4 and IPv6 happens during a call to
497<a href=#sendto><tt>sendto</tt></a>, <a 497<a href="#sendto"><tt>sendto</tt></a>, <a
498href=#setpeername><tt>setpeername</tt></a>, or <a 498href="#setpeername"><tt>setpeername</tt></a>, or <a
499href=#setsockname><tt>sockname</tt></a>, depending on the address 499href="#setsockname"><tt>sockname</tt></a>, depending on the address
500family obtained from the resolver. 500family obtained from the resolver.
501</p> 501</p>
502 502
503<p class=note> 503<p class="note">
504Note: Before the choice between IPv4 and IPv6 happens, 504Note: Before the choice between IPv4 and IPv6 happens,
505the internal socket object is invalid and therefore <a 505the internal socket object is invalid and therefore <a
506href=#setoption><tt>setoption</tt></a> will fail. 506href="#setoption"><tt>setoption</tt></a> will fail.
507</p> 507</p>
508 508
509<!-- socket.udp4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 509<!-- socket.udp4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
510 510
511<p class="name" id="socket.udp"> 511<p class="name" id="socket.udp4">
512socket.<b>udp4()</b> 512socket.<b>udp4()</b>
513</p> 513</p>
514 514
@@ -564,7 +564,7 @@ returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
564an error message. 564an error message.
565</p> 565</p>
566 566
567<p class=note> 567<p class="note">
568Note: The TCP object returned will have the option 568Note: The TCP object returned will have the option
569"<tt>ipv6-v6only</tt>" set to <tt><b>true</b></tt>. 569"<tt>ipv6-v6only</tt>" set to <tt><b>true</b></tt>.
570</p> 570</p>
@@ -573,10 +573,10 @@ Note: The TCP object returned will have the option
573 573
574<!-- footer ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 574<!-- footer ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
575 575
576<div class=footer> 576<div class="footer">
577<hr> 577<hr>
578<center> 578<center>
579<p class=bar> 579<p class="bar">
580<a href="index.html">home</a> &middot; 580<a href="index.html">home</a> &middot;
581<a href="index.html#download">download</a> &middot; 581<a href="index.html#download">download</a> &middot;
582<a href="installation.html">installation</a> &middot; 582<a href="installation.html">installation</a> &middot;