From 944305dc21350fd2ec32a9552d893da86894fd62 Mon Sep 17 00:00:00 2001
From: Diego Nehab
-socket.udp()
-
-Creates and returns an unconnected UDP object.
-Unconnected objects support the
-sendto,
-receive,
-receivefrom,
-getoption,
-getsockname,
-setoption,
-settimeout,
-setpeername,
-setsockname, and
-close.
-The setpeername
-is used to connect the object.
-
-In case of success, a new unconnected UDP object
-returned. In case of error, nil is returned, followed by
-an error message.
-
-Note: The choice between IPv4 and IPv6 happens during a call to
-sendto, setpeername, or sockname, depending on the address
-family obtained from the resolver.
-
-Note: Before the choice between IPv4 and IPv6 happens,
-the internal socket object is invalid and therefore setoption will fail.
-
-socket.udp4()
-
-Creates and returns an unconnected IPv4 UDP object.
-Unconnected objects support the
-sendto,
-receive,
-receivefrom,
-getoption,
-getsockname,
-setoption,
-settimeout,
-setpeername,
-setsockname, and
-close.
-The setpeername
-is used to connect the object.
-
-In case of success, a new unconnected UDP object
-returned. In case of error, nil is returned, followed by
-an error message.
-
-socket.udp6()
-
-Creates and returns an unconnected IPv6 UDP object.
-Unconnected objects support the
-sendto,
-receive,
-receivefrom,
-getoption,
-getsockname,
-setoption,
-settimeout,
-setpeername,
-setsockname, and
-close.
-The setpeername
-is used to connect the object.
-
-In case of success, a new unconnected UDP object
-returned. In case of error, nil is returned, followed by
-an error message.
-
-Note: The TCP object returned will have the option
-"ipv6-v6only" set to true.
-
@@ -168,6 +62,40 @@ Garbage-collected objects are automatically closed before
destruction, though.
+connected:getoption()
+Gets an option value from the UDP object.
+See setoption for
+description of the option names and values.
+ Option is a string with the option name.
+UDP
-
-
-
+unconnected:getoption()
+
+
+
+The method returns the option value in case of +success, or +nil followed by an error message otherwise. +
+@@ -218,6 +146,18 @@ first time (in which case it is bound to an ephemeral port and the wild-card address).
+ + +
+connected:settimeout(value)
+unconnected:settimeout(value)
+
+Returns the current timeout value. +
+ +@@ -265,40 +205,6 @@ address and port as extra return values (and is therefore slightly less efficient).
- - -
-connected:getoption()
-unconnected:getoption()
-
-Gets an option value from the UDP object. -See setoption for -description of the option names and values. -
- -Option is a string with the option name. -
-The method returns the option value in case of -success, or -nil followed by an error message otherwise. -
-@@ -362,6 +268,75 @@ refuses to send a message to the specified address (i.e. no interface accepts the address).
+ + +
+connected:setoption(option [, value])
+unconnected:setoption(option [, value])
+
+Sets options for the UDP object. Options are +only needed by low-level or time-critical applications. You should +only modify an option if you are sure you need it.
+Option is a string with the option +name, and value depends on the option being set: +
+ ++The method returns 1 in case of success, or +nil followed by an error message otherwise. +
+ ++Note: The descriptions above come from the man pages. +
+ +@@ -448,74 +423,6 @@ system or explicitly by setsockname, it cannot be changed.
- - -
-connected:setoption(option [, value])
-unconnected:setoption(option [, value])
-
-Sets options for the UDP object. Options are -only needed by low-level or time-critical applications. You should -only modify an option if you are sure you need it.
-Option is a string with the option -name, and value depends on the option being set: -
- --The method returns 1 in case of success, or -nil followed by an error message otherwise. -
- --Note: The descriptions above come from the man pages. -
-@@ -556,6 +463,114 @@ all other method names already contained verbs making their imperative nature obvious.
+ + ++socket.udp() +
+ ++Creates and returns an unconnected UDP object. +Unconnected objects support the +sendto, +receive, +receivefrom, +getoption, +getsockname, +setoption, +settimeout, +setpeername, +setsockname, and +close. +The setpeername +is used to connect the object. +
+ ++In case of success, a new unconnected UDP object +returned. In case of error, nil is returned, followed by +an error message. +
+ ++Note: The choice between IPv4 and IPv6 happens during a call to +sendto, setpeername, or sockname, depending on the address +family obtained from the resolver. +
+ ++Note: Before the choice between IPv4 and IPv6 happens, +the internal socket object is invalid and therefore setoption will fail. +
+ + + ++socket.udp4() +
+ ++Creates and returns an unconnected IPv4 UDP object. +Unconnected objects support the +sendto, +receive, +receivefrom, +getoption, +getsockname, +setoption, +settimeout, +setpeername, +setsockname, and +close. +The setpeername +is used to connect the object. +
+ ++In case of success, a new unconnected UDP object +returned. In case of error, nil is returned, followed by +an error message. +
+ + + ++socket.udp6() +
+ ++Creates and returns an unconnected IPv6 UDP object. +Unconnected objects support the +sendto, +receive, +receivefrom, +getoption, +getsockname, +setoption, +settimeout, +setpeername, +setsockname, and +close. +The setpeername +is used to connect the object. +
+ ++In case of success, a new unconnected UDP object +returned. In case of error, nil is returned, followed by +an error message. +
+ ++Note: The TCP object returned will have the option +"ipv6-v6only" set to true. +
+ + +