diff options
Diffstat (limited to 'doc/udp.html')
| -rw-r--r-- | doc/udp.html | 94 |
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> · | 27 | <a href="index.html">home</a> · |
| 28 | <a href="index.html#download">download</a> · | 28 | <a href="index.html#download">download</a> · |
| 29 | <a href="installation.html">installation</a> · | 29 | <a href="installation.html">installation</a> · |
| @@ -71,26 +71,26 @@ unconnected:<b>getoption()</b> | |||
| 71 | 71 | ||
| 72 | <p class="description"> | 72 | <p class="description"> |
| 73 | Gets an option value from the UDP object. | 73 | Gets an option value from the UDP object. |
| 74 | See <a href=#setoption><tt>setoption</tt></a> for | 74 | See <a href="#setoption"><tt>setoption</tt></a> for |
| 75 | description of the option names and values. | 75 | description 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"> |
| 94 | The method returns the option <tt>value</tt> in case of | 94 | The method returns the option <tt>value</tt> in case of |
| 95 | success, or | 95 | success, 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"> |
| 112 | Returns a string with the IP address of the peer, the | 112 | Returns a string with the IP address of the peer, the |
| 113 | port number that peer is using for the connection, | 113 | port number that peer is using for the connection, |
| 114 | and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>"). | 114 | and 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"> |
| 135 | The method returns a string with local IP address, a number with | 135 | The method returns a string with local IP address, a number with |
| 136 | the local port, | 136 | the local port, |
| 137 | and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>"). | 137 | and 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"> |
| 152 | connected:<b>settimeout(</b>value<b>)</b><br> | 152 | connected:<b>settimeout(</b>value<b>)</b><br> |
| 153 | unconnected:<b>settimeout(</b>value<b>)</b> | 153 | unconnected:<b>settimeout(</b>value<b>)</b> |
| 154 | </p> | 154 | </p> |
| 155 | 155 | ||
| 156 | <p class=description> | 156 | <p class="description"> |
| 157 | Returns the current timeout value. | 157 | Returns 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 |
| 181 | available bytes are returned. | 181 | available bytes are returned. |
| 182 | If <tt>size</tt> is omitted, the | 182 | If <tt>size</tt> is omitted, the |
| 183 | compile-time constant <a | 183 | compile-time constant <a href="socket.html#datagramsize"> |
| 184 | href=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 |
| 186 | temporary buffer to be allocated for the operation. | 186 | temporary 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 |
| 288 | messages should bypass the standard routing facilities. | 288 | messages should bypass the standard routing facilities. |
| 289 | Receives a boolean value; | 289 | Receives a boolean value;</li> |
| 290 | <li> '<tt>broadcast</tt>': Requests permission to send | 290 | <li> '<tt>broadcast</tt>': Requests permission to send |
| 291 | broadcast datagrams on the socket. | 291 | broadcast datagrams on the socket. |
| 292 | Receives a boolean value; | 292 | Receives 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 |
| 294 | validating addresses supplied in a <tt>bind()</tt> call | 294 | validating addresses supplied in a <tt>bind()</tt> call |
| 295 | should allow reuse of local addresses. | 295 | should allow reuse of local addresses. |
| 296 | Receives a boolean value; | 296 | Receives a boolean value;</li> |
| 297 | <li> '<tt>reuseport</tt>': Allows completely duplicate | 297 | <li> '<tt>reuseport</tt>': Allows completely duplicate |
| 298 | bindings by multiple processes if they all set | 298 | bindings by multiple processes if they all set |
| 299 | '<tt>reuseport</tt>' before binding the port. | 299 | '<tt>reuseport</tt>' before binding the port. |
| 300 | Receives a boolean value; | 300 | Receives a boolean value;</li> |
| 301 | <li> '<tt>ip-multicast-loop</tt>': | 301 | <li> '<tt>ip-multicast-loop</tt>': |
| 302 | Specifies whether or not a copy of an outgoing multicast | 302 | Specifies whether or not a copy of an outgoing multicast |
| 303 | datagram is delivered to the sending host as long as it is a | 303 | datagram is delivered to the sending host as long as it is a |
| 304 | member of the multicast group. | 304 | member of the multicast group. |
| 305 | Receives a boolean value; | 305 | Receives a boolean value;</li> |
| 306 | <li> '<tt>ipv6-v6only</tt>': | 306 | <li> '<tt>ipv6-v6only</tt>': |
| 307 | Specifies whether to restrict <tt>inet6</tt> sockets to | 307 | Specifies whether to restrict <tt>inet6</tt> sockets to |
| 308 | sending and receiving only IPv6 packets. | 308 | sending and receiving only IPv6 packets. |
| 309 | Receive a boolean value; | 309 | Receive a boolean value;</li> |
| 310 | <li> '<tt>ip-multicast-if</tt>': | 310 | <li> '<tt>ip-multicast-if</tt>': |
| 311 | Sets the interface over which outgoing multicast datagrams | 311 | Sets the interface over which outgoing multicast datagrams |
| 312 | are sent. | 312 | are sent. |
| 313 | Receives an IP address; | 313 | Receives an IP address;</li> |
| 314 | <li> '<tt>ip-multicast-ttl</tt>': | 314 | <li> '<tt>ip-multicast-ttl</tt>': |
| 315 | Sets the Time To Live in the IP header for outgoing | 315 | Sets the Time To Live in the IP header for outgoing |
| 316 | multicast datagrams. | 316 | multicast datagrams. |
| 317 | Receives a number; | 317 | Receives a number;</li> |
| 318 | <li> '<tt>ip-add-membership</tt>': | 318 | <li> '<tt>ip-add-membership</tt>': |
| 319 | Joins the multicast group specified. | 319 | Joins the multicast group specified. |
| 320 | Receives a table with fields | 320 | Receives 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 |
| 322 | IP address; | 322 | IP address;</li> |
| 323 | <li> '<tt>ip-drop-membership</tt>': Leaves the multicast | 323 | <li> '<tt>ip-drop-membership</tt>': Leaves the multicast |
| 324 | group specified. | 324 | group specified. |
| 325 | Receives a table with fields | 325 | Receives 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 |
| 327 | IP address. | 327 | IP 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"> |
| 336 | Note: The descriptions above come from the man pages. | 336 | Note: 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 | |||
| 381 | and can result in up to 30% performance gains. | 381 | and can result in up to 30% performance gains. |
| 382 | </p> | 382 | </p> |
| 383 | 383 | ||
| 384 | <p class=note> | 384 | <p class="note"> |
| 385 | Note: Starting with LuaSocket 3.0, the host name resolution | 385 | Note: Starting with LuaSocket 3.0, the host name resolution |
| 386 | depends on whether the socket was created by <a | 386 | depends on whether the socket was created by <a |
| 387 | href=#socket.udp><tt>socket.udp</tt></a> or <a | 387 | href="#socket.udp"><tt>socket.udp</tt></a> or <a |
| 388 | href=#socket.udp6><tt>socket.udp6</tt></a>. Addresses from | 388 | href="#socket.udp6"><tt>socket.udp6</tt></a>. Addresses from |
| 389 | the appropriate family are tried in succession until the | 389 | the appropriate family are tried in succession until the |
| 390 | first success or until the last failure. | 390 | first 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 | |||
| 492 | an error message. | 492 | an error message. |
| 493 | </p> | 493 | </p> |
| 494 | 494 | ||
| 495 | <p class=note> | 495 | <p class="note"> |
| 496 | Note: The choice between IPv4 and IPv6 happens during a call to | 496 | Note: 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 |
| 498 | href=#setpeername><tt>setpeername</tt></a>, or <a | 498 | href="#setpeername"><tt>setpeername</tt></a>, or <a |
| 499 | href=#setsockname><tt>sockname</tt></a>, depending on the address | 499 | href="#setsockname"><tt>sockname</tt></a>, depending on the address |
| 500 | family obtained from the resolver. | 500 | family obtained from the resolver. |
| 501 | </p> | 501 | </p> |
| 502 | 502 | ||
| 503 | <p class=note> | 503 | <p class="note"> |
| 504 | Note: Before the choice between IPv4 and IPv6 happens, | 504 | Note: Before the choice between IPv4 and IPv6 happens, |
| 505 | the internal socket object is invalid and therefore <a | 505 | the internal socket object is invalid and therefore <a |
| 506 | href=#setoption><tt>setoption</tt></a> will fail. | 506 | href="#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"> |
| 512 | socket.<b>udp4()</b> | 512 | socket.<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 | |||
| 564 | an error message. | 564 | an error message. |
| 565 | </p> | 565 | </p> |
| 566 | 566 | ||
| 567 | <p class=note> | 567 | <p class="note"> |
| 568 | Note: The TCP object returned will have the option | 568 | Note: 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> · | 580 | <a href="index.html">home</a> · |
| 581 | <a href="index.html#download">download</a> · | 581 | <a href="index.html#download">download</a> · |
| 582 | <a href="installation.html">installation</a> · | 582 | <a href="installation.html">installation</a> · |
