From 944305dc21350fd2ec32a9552d893da86894fd62 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Fri, 4 Mar 2016 15:36:32 -0300 Subject: Added gettimeout for completeness. Also documented. Rordered manuals so order is alphabetical. --- doc/udp.html | 431 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 223 insertions(+), 208 deletions(-) (limited to 'doc/udp.html') diff --git a/doc/udp.html b/doc/udp.html index 9437c51..4618aad 100644 --- a/doc/udp.html +++ b/doc/udp.html @@ -39,112 +39,6 @@

UDP

- - -

-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()
+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. +

+

@@ -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. +

+ + +