summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luasocket/doc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket/doc')
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html1
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/http.html7
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/index.html59
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html14
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html8
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.pptbin0 -> 304128 bytes
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html59
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css1
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html6
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html235
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html118
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html405
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html447
13 files changed, 765 insertions, 595 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html
index 3f23a4a93cc..091c88f7838 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html
@@ -86,7 +86,6 @@ the FTP module:
<ul>
<li> <tt>PASSWORD</tt>: default anonymous password.
-<li> <tt>PORT</tt>: default port used for the control connection;
<li> <tt>TIMEOUT</tt>: sets the timeout for all I/O operations;
<li> <tt>USER</tt>: default anonymous user;
</ul>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html
index cd41c0ddb9e..3b7a8b1a26a 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html
@@ -112,12 +112,15 @@ the HTTP module:
</p>
<ul>
-<li> <tt>PORT</tt>: default port used for connections;
-<li> <tt>PROXY</tt>: default proxy used for connections;
+<li> <tt>PROXY</tt>: default proxy used for connections;
<li> <tt>TIMEOUT</tt>: sets the timeout for all I/O operations;
<li> <tt>USERAGENT</tt>: default user agent reported to server.
</ul>
+<p class=note id="post">
+Note: These constants are global. Changing them will also
+change the behavior other code that might be using LuaSocket.
+</p>
<!-- http.request ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html
index d8ee4a492d2..7d81b411d0c 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html
@@ -49,7 +49,7 @@ functionality commonly needed by applications that deal with the Internet.
The core support has been implemented so that it is both efficient and
simple to use. It is available to any Lua application once it has been
properly initialized by the interpreter in use. The code has been tested
-and runs well on several Windows and Unix platforms. </p>
+and runs well on several Windows and UNIX platforms. </p>
<p>
Among the support modules, the most commonly used implement the
@@ -78,7 +78,7 @@ LuaSocket.
</p>
<p>
-Copyright &copy; 1999-2012 Diego Nehab. All rights reserved. <br>
+Copyright &copy; 1999-2013 Diego Nehab. All rights reserved. <br>
Author: <A href="http://www.impa.br/~diego">Diego Nehab</a>
</p>
@@ -87,16 +87,16 @@ Author: <A href="http://www.impa.br/~diego">Diego Nehab</a>
<h2 id=download>Download</h2>
<p>
-LuaSocket version 2.1-rc1 is now available for download!
+LuaSocket version 3.0-rc1 is now available for download!
It is compatible with Lua&nbsp;5.1 and 5.2, and has
been tested on Windows&nbsp;XP, Linux, and Mac OS X. Chances
are it works well on most UNIX distributions and Windows flavors.
</p>
<p>
-The library can be downloaded in source code from the
-<a href="https://github.com/diegonehab/luasocket/downloads">LuaSocket
-project page</a> at GitHub. Besides the full C and Lua source code
+The current version of the library can be found at
+the <a href="https://github.com/diegonehab/luasocket">LuaSocket
+project page</a> on GitHub. Besides the full C and Lua source code
for the library, the distribution contains several examples,
this user's manual and basic test procedures.
</p>
@@ -113,11 +113,12 @@ manual to find out how to properly install the library.
<p>
This marks the first release of LuaSocket that
wholeheartedly embraces the open-source development
-philosophy. After a long hiatus, Matthew Wild finally
-convinced me it was time for a release including IPv6
-and Lua 5.2 support. Special thanks to Sam Roberts, Florian
-Zeitz, and Paul Aurich, Liam Devine, and everybody else that
-has helped bring this library back to life.
+philosophy. After a long hiatus, Matthew Wild finally
+convinced me it was time for a release including IPv6 and
+Lua 5.2 support. It was more work than we anticipated.
+Special thanks to Sam Roberts, Florian Zeitz, and Paul
+Aurich, Liam Devine, Alexey Melnichuk, and everybody else
+that has helped bring this library back to life.
</p>
<!-- whatsnew +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -125,12 +126,16 @@ has helped bring this library back to life.
<h2 id=new>What's New</h2>
<p>
-Main changes for LuaSocket&nbsp;2.1-rc1 are IPv6 support
+Main changes for LuaSocket&nbsp;3.0-rc1 are IPv6 support
and Lua&nbsp;5.2 compatibility.
</p>
<ul>
-<li> Added: Compatible with Lua&nbsp;5.2 (using <tt>LUA_COMPAT_MODULE</tt>);
+<li> Added: Compatible with Lua&nbsp;5.2
+<ul>
+<li> Note that unless you define <tt>LUA_COMPAT_MODULE</tt>,
+package tables will <em>not</em> be exported as globals!
+</ul>
<li> Added: IPv6 support;
<ul>
<li> <tt>Socket.connect</tt> and <tt>socket.bind</tt> support IPv6 addresses;
@@ -138,7 +143,8 @@ and Lua&nbsp;5.2 compatibility.
IPv6 addresses, and return the socket family as a third value;
<li> URL module updated to support IPv6 host names;
<li> New <tt>socket.tcp6</tt> and <tt>socket.udp6</tt> functions;
-<li> New <tt>socket.dns.getaddrinfo</tt> function;
+<li> New <tt>socket.dns.getaddrinfo</tt> and
+ <tt>socket.dns.getnameinfo</tt> functions;
</ul>
<li> Added: <tt>getoption</tt> method;
<li> Fixed: <tt>url.unescape</tt> was returning additional values;
@@ -149,6 +155,29 @@ IPv6 addresses, and return the socket family as a third value;
<li> Improved: Hidden all internal library symbols;
<li> Improved: Better error messages;
<li> Improved: Better documentation of socket options.
+<li> Fixed: manual sample of HTTP authentication now uses correct
+ "authorization" header (Alexandre Ittner);
+<li> Fixed: failure on bind() was destroying the socket (Sam Roberts);
+<li> Fixed: receive() returns immediatelly if prefix can satisfy
+ bytes requested (M Joonas Pihlaja);
+<li> Fixed: multicast didn't work on Windows, or anywhere
+ else for that matter (Herbert Leuwer, Adrian Sietsma);
+<li> Fixed: select() now reports an error when called with more
+ sockets than FD_SETSIZE (Lorenzo Leonini);
+<li> Fixed: manual links to home.html changed to index.html
+(Robert Hahn);
+<li> Fixed: mime.unb64() would return an empty string on results that started
+ with a null character (Robert Raschke);
+<li> Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray);
+<li> Fixed: calling sleep() with negative numbers could
+ block forever, wasting CPU. Now it returns immediately (MPB);
+<li> Improved: FTP commands are now sent in upper case to
+ help buggy servers (Anders Eurenius);
+<li> Improved: known headers now sent in canonic
+ capitalization to help buggy servers (Joseph Stewart);
+<li> Improved: Clarified tcp:receive() in the manual (MPB);
+<li> Improved: Decent makefiles (LHF).
+<li> Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei).
</ul>
<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -176,7 +205,7 @@ still available for those that have compatibility issues.
<p>
<small>
Last modified by Diego Nehab on <br>
-Mon Apr 16 21:58:56 HKT 2012
+Tue Jun 11 18:50:23 HKT 2013
</small>
</p>
</center>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html
index 37c309b5d24..28a9fbb5f22 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html
@@ -39,12 +39,6 @@ Installation">
<h2>Installation</h2>
-<p> LuaSocket 2.1-rc still uses Lua&nbsp;5.1's package
-system. Users that have already made the switch to
-Lua&nbsp;5.2 should leave the default
-<tt>LUA_COMPAT_MODULE</tt> defined when compiling their Lua
-distribution for compatibility with LuaSocket. </p>
-
<p> Here we describe the standard distribution. If the
standard doesn't meet your needs, we refer you to the Lua
discussion list, where any question about the package scheme
@@ -92,17 +86,17 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the
<tt>require</tt> function to gain access to whatever module you need:</p>
<pre class=example>
-Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
+Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
&gt; socket = require("socket")
&gt; print(socket._VERSION)
---&gt; LuaSocket 2.1-rc1
+--&gt; LuaSocket 3.0-rc1
</pre>
<p> Each module loads their dependencies automatically, so you only need to
load the modules you directly depend upon: </p>
<pre class=example>
-Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
+Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
&gt; http = require("socket.http")
&gt; print(http.request("http://www.impa.br/~diego/software/luasocket"))
--&gt; homepage gets dumped to terminal
@@ -123,7 +117,7 @@ Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
<p>
<small>
Last modified by Diego Nehab on <br>
-Mon Apr 16 21:01:42 HKT 2012
+Tue Jun 11 19:06:14 HKT 2013
</small>
</p>
</center>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html
index 7e2f49a8c4c..54e66fb6bb0 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html
@@ -224,8 +224,8 @@ local ltn12 = require("ltn12")
-- copy a file
ltn12.pump.all(
- ltn12.source.file(io.open("original.png")),
- ltn12.sink.file(io.open("copy.png"))
+ ltn12.source.file(io.open("original.png", "rb")),
+ ltn12.sink.file(io.open("copy.png", "wb"))
)
</pre>
@@ -379,8 +379,8 @@ local ltn12 = require("ltn12")
-- copy a file
ltn12.pump.all(
- ltn12.source.file(io.open("original.png")),
- ltn12.sink.file(io.open("copy.png"))
+ ltn12.source.file(io.open("original.png", "rb")),
+ ltn12.sink.file(io.open("copy.png", "wb"))
)
</pre>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt b/Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt
new file mode 100644
index 00000000000..e2b7ab4b304
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt
Binary files differ
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html
index ae136fd85d1..8cb3507aa7b 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html
@@ -72,34 +72,6 @@ local mime = require("mime")
<h3 id=high>High-level filters</h3>
-<!-- normalize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class=name id="normalize">
-mime.<b>normalize(</b>[marker]<b>)</b>
-</p>
-
-<p class=description>
-Converts most common end-of-line markers to a specific given marker.
-</p>
-
-<p class=parameters>
-<tt>Marker</tt> is the new marker. It defaults to CRLF, the canonic
-end-of-line marker defined by the MIME standard.
-</p>
-
-<p class=return>
-The function returns a filter that performs the conversion.
-</p>
-
-<p class=note>
-Note: There is no perfect solution to this problem. Different end-of-line
-markers are an evil that will probably plague developers forever.
-This function, however, will work perfectly for text created with any of
-the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF),
-or the DOS (CRLF) conventions. Even if the data has mixed end-of-line
-markers, the function will still work well, although it doesn't
-guarantee that the number of empty lines will be correct.
-</p>
<!-- decode +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -159,6 +131,35 @@ base64 = ltn12.filter.chain(
)
</pre>
+<!-- normalize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="normalize">
+mime.<b>normalize(</b>[marker]<b>)</b>
+</p>
+
+<p class=description>
+Converts most common end-of-line markers to a specific given marker.
+</p>
+
+<p class=parameters>
+<tt>Marker</tt> is the new marker. It defaults to CRLF, the canonic
+end-of-line marker defined by the MIME standard.
+</p>
+
+<p class=return>
+The function returns a filter that performs the conversion.
+</p>
+
+<p class=note>
+Note: There is no perfect solution to this problem. Different end-of-line
+markers are an evil that will probably plague developers forever.
+This function, however, will work perfectly for text created with any of
+the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF),
+or the DOS (CRLF) conventions. Even if the data has mixed end-of-line
+markers, the function will still work well, although it doesn't
+guarantee that the number of empty lines will be correct.
+</p>
+
<!-- stuff +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="stuff">
@@ -466,7 +467,7 @@ marker.
<p>
<small>
Last modified by Diego Nehab on <br>
-Thu Apr 20 00:25:44 EDT 2006
+Fri Mar 4 15:19:17 BRT 2016
</small>
</p>
</center>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css
index b1dd25d70bb..04e38cfebeb 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css
@@ -2,6 +2,7 @@ body {
margin-left: 1em;
margin-right: 1em;
font-family: "Verdana", sans-serif;
+ background: #ffffff;
}
tt {
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html
index e9bb5eb6fcc..287dc19d900 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html
@@ -147,6 +147,7 @@ Support, Manual">
<a href="socket.html#connect">connect</a>,
<a href="socket.html#connect">connect4</a>,
<a href="socket.html#connect">connect6</a>,
+<a href="socket.html#datagramsize">_DATAGRAMSIZE</a>,
<a href="socket.html#debug">_DEBUG</a>,
<a href="dns.html#dns">dns</a>,
<a href="socket.html#gettime">gettime</a>,
@@ -158,11 +159,14 @@ Support, Manual">
<a href="socket.html#skip">skip</a>,
<a href="socket.html#sleep">sleep</a>,
<a href="socket.html#setsize">_SETSIZE</a>,
+<a href="socket.html#socketinvalid">_SOCKETINVALID</a>,
<a href="socket.html#source">source</a>,
<a href="tcp.html#socket.tcp">tcp</a>,
+<a href="tcp.html#socket.tcp4">tcp4</a>,
<a href="tcp.html#socket.tcp6">tcp6</a>,
<a href="socket.html#try">try</a>,
<a href="udp.html#socket.udp">udp</a>,
+<a href="udp.html#socket.udp4">udp4</a>,
<a href="udp.html#socket.udp6">udp6</a>,
<a href="socket.html#version">_VERSION</a>.
</blockquote>
@@ -183,6 +187,7 @@ Support, Manual">
<a href="tcp.html#getpeername">getpeername</a>,
<a href="tcp.html#getsockname">getsockname</a>,
<a href="tcp.html#getstats">getstats</a>,
+<a href="tcp.html#gettimeout">gettimeout</a>,
<a href="tcp.html#listen">listen</a>,
<a href="tcp.html#receive">receive</a>,
<a href="tcp.html#send">send</a>,
@@ -203,6 +208,7 @@ Support, Manual">
<a href="udp.html#getoption">getoption</a>,
<a href="udp.html#getpeername">getpeername</a>,
<a href="udp.html#getsockname">getsockname</a>,
+<a href="udp.html#gettimeout">gettimeout</a>,
<a href="udp.html#receive">receive</a>,
<a href="udp.html#receivefrom">receivefrom</a>,
<a href="udp.html#send">send</a>,
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html
index bbbff8047b9..600ec37529f 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html
@@ -114,6 +114,124 @@ the SMTP module:
<li> <tt>ZONE</tt>: default time zone.
</ul>
+<!-- message ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=message>
+smtp.<b>message(</b>mesgt<b>)</b>
+</p>
+
+<p class=description>
+Returns a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> source that sends an SMTP message body, possibly multipart (arbitrarily deep).
+</p>
+
+<p class=parameters>
+The only parameter of the function is a table describing the message.
+<tt>Mesgt</tt> has the following form (notice the recursive structure):
+</p>
+
+<blockquote>
+<table summary="Mesgt table structure">
+<tr><td><tt>
+mesgt = {<br>
+&nbsp;&nbsp;headers = <i>header-table</i>,<br>
+&nbsp;&nbsp;body = <i>LTN12 source</i> or <i>string</i> or
+<i>multipart-mesgt</i><br>
+}<br>
+&nbsp;<br>
+multipart-mesgt = {<br>
+&nbsp;&nbsp;[preamble = <i>string</i>,]<br>
+&nbsp;&nbsp;[1] = <i>mesgt</i>,<br>
+&nbsp;&nbsp;[2] = <i>mesgt</i>,<br>
+&nbsp;&nbsp;...<br>
+&nbsp;&nbsp;[<i>n</i>] = <i>mesgt</i>,<br>
+&nbsp;&nbsp;[epilogue = <i>string</i>,]<br>
+}<br>
+</tt></td></tr>
+</table>
+</blockquote>
+
+<p class=parameters>
+For a simple message, all that is needed is a set of <tt>headers</tt>
+and the <tt>body</tt>. The message <tt>body</tt> can be given as a string
+or as a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source. For multipart messages, the body is a table that
+recursively defines each part as an independent message, plus an optional
+<tt>preamble</tt> and <tt>epilogue</tt>.
+</p>
+
+<p class=return>
+The function returns a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source that produces the
+message contents as defined by <tt>mesgt</tt>, chunk by chunk.
+Hopefully, the following
+example will make things clear. When in doubt, refer to the appropriate RFC
+as listed in the introduction. </p>
+
+<pre class=example>
+-- load the smtp support and its friends
+local smtp = require("socket.smtp")
+local mime = require("mime")
+local ltn12 = require("ltn12")
+
+-- creates a source to send a message with two parts. The first part is
+-- plain text, the second part is a PNG image, encoded as base64.
+source = smtp.message{
+ headers = {
+ -- Remember that headers are *ignored* by smtp.send.
+ from = "Sicrano de Oliveira &lt;sicrano@example.com&gt;",
+ to = "Fulano da Silva &lt;fulano@example.com&gt;",
+ subject = "Here is a message with attachments"
+ },
+ body = {
+ preamble = "If your client doesn't understand attachments, \r\n" ..
+ "it will still display the preamble and the epilogue.\r\n" ..
+ "Preamble will probably appear even in a MIME enabled client.",
+ -- first part: no headers means plain text, us-ascii.
+ -- The mime.eol low-level filter normalizes end-of-line markers.
+ [1] = {
+ body = mime.eol(0, [[
+ Lines in a message body should always end with CRLF.
+ The smtp module will *NOT* perform translation. However, the
+ send function *DOES* perform SMTP stuffing, whereas the message
+ function does *NOT*.
+ ]])
+ },
+ -- second part: headers describe content to be a png image,
+ -- sent under the base64 transfer content encoding.
+ -- notice that nothing happens until the message is actually sent.
+ -- small chunks are loaded into memory right before transmission and
+ -- translation happens on the fly.
+ [2] = {
+ headers = {
+ ["content-type"] = 'image/png; name="image.png"',
+ ["content-disposition"] = 'attachment; filename="image.png"',
+ ["content-description"] = 'a beautiful image',
+ ["content-transfer-encoding"] = "BASE64"
+ },
+ body = ltn12.source.chain(
+ ltn12.source.file(io.open("image.png", "rb")),
+ ltn12.filter.chain(
+ mime.encode("base64"),
+ mime.wrap()
+ )
+ )
+ },
+ epilogue = "This might also show up, but after the attachments"
+ }
+}
+
+-- finally send it
+r, e = smtp.send{
+ from = "&lt;sicrano@example.com&gt;",
+ rcpt = "&lt;fulano@example.com&gt;",
+ source = source,
+}
+</pre>
+
+
<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=send>
@@ -275,123 +393,6 @@ r, e = smtp.send{
}
</pre>
-<!-- message ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class=name id=message>
-smtp.<b>message(</b>mesgt<b>)</b>
-</p>
-
-<p class=description>
-Returns a <em>simple</em>
-<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> source that sends an SMTP message body, possibly multipart (arbitrarily deep).
-</p>
-
-<p class=parameters>
-The only parameter of the function is a table describing the message.
-<tt>Mesgt</tt> has the following form (notice the recursive structure):
-</p>
-
-<blockquote>
-<table summary="Mesgt table structure">
-<tr><td><tt>
-mesgt = {<br>
-&nbsp;&nbsp;headers = <i>header-table</i>,<br>
-&nbsp;&nbsp;body = <i>LTN12 source</i> or <i>string</i> or
-<i>multipart-mesgt</i><br>
-}<br>
-&nbsp;<br>
-multipart-mesgt = {<br>
-&nbsp;&nbsp;[preamble = <i>string</i>,]<br>
-&nbsp;&nbsp;[1] = <i>mesgt</i>,<br>
-&nbsp;&nbsp;[2] = <i>mesgt</i>,<br>
-&nbsp;&nbsp;...<br>
-&nbsp;&nbsp;[<i>n</i>] = <i>mesgt</i>,<br>
-&nbsp;&nbsp;[epilogue = <i>string</i>,]<br>
-}<br>
-</tt></td></tr>
-</table>
-</blockquote>
-
-<p class=parameters>
-For a simple message, all that is needed is a set of <tt>headers</tt>
-and the <tt>body</tt>. The message <tt>body</tt> can be given as a string
-or as a <em>simple</em>
-<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
-source. For multipart messages, the body is a table that
-recursively defines each part as an independent message, plus an optional
-<tt>preamble</tt> and <tt>epilogue</tt>.
-</p>
-
-<p class=return>
-The function returns a <em>simple</em>
-<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
-source that produces the
-message contents as defined by <tt>mesgt</tt>, chunk by chunk.
-Hopefully, the following
-example will make things clear. When in doubt, refer to the appropriate RFC
-as listed in the introduction. </p>
-
-<pre class=example>
--- load the smtp support and its friends
-local smtp = require("socket.smtp")
-local mime = require("mime")
-local ltn12 = require("ltn12")
-
--- creates a source to send a message with two parts. The first part is
--- plain text, the second part is a PNG image, encoded as base64.
-source = smtp.message{
- headers = {
- -- Remember that headers are *ignored* by smtp.send.
- from = "Sicrano de Oliveira &lt;sicrano@example.com&gt;",
- to = "Fulano da Silva &lt;fulano@example.com&gt;",
- subject = "Here is a message with attachments"
- },
- body = {
- preamble = "If your client doesn't understand attachments, \r\n" ..
- "it will still display the preamble and the epilogue.\r\n" ..
- "Preamble will probably appear even in a MIME enabled client.",
- -- first part: no headers means plain text, us-ascii.
- -- The mime.eol low-level filter normalizes end-of-line markers.
- [1] = {
- body = mime.eol(0, [[
- Lines in a message body should always end with CRLF.
- The smtp module will *NOT* perform translation. However, the
- send function *DOES* perform SMTP stuffing, whereas the message
- function does *NOT*.
- ]])
- },
- -- second part: headers describe content to be a png image,
- -- sent under the base64 transfer content encoding.
- -- notice that nothing happens until the message is actually sent.
- -- small chunks are loaded into memory right before transmission and
- -- translation happens on the fly.
- [2] = {
- headers = {
- ["content-type"] = 'image/png; name="image.png"',
- ["content-disposition"] = 'attachment; filename="image.png"',
- ["content-description"] = 'a beautiful image',
- ["content-transfer-encoding"] = "BASE64"
- },
- body = ltn12.source.chain(
- ltn12.source.file(io.open("image.png", "rb")),
- ltn12.filter.chain(
- mime.encode("base64"),
- mime.wrap()
- )
- )
- },
- epilogue = "This might also show up, but after the attachments"
- }
-}
-
--- finally send it
-r, e = smtp.send{
- from = "&lt;sicrano@example.com&gt;",
- rcpt = "&lt;fulano@example.com&gt;",
- source = source,
-}
-</pre>
-
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<div class=footer>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
index b9303cb505a..35f8391c845 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
@@ -51,6 +51,30 @@ To obtain the <tt>socket</tt> namespace, run:
local socket = require("socket")
</pre>
+<!-- headers.canonic ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="headers.canonic">
+socket.headers.<b>canonic</b></p>
+
+<p> The <tt>socket.headers.canonic</tt> table
+is used by the HTTP and SMTP modules to translate from
+lowercase field names back into their canonic
+capitalization. When a lowercase field name exists as a key
+in this table, the associated value is substituted in
+whenever the field name is sent out.
+</p>
+
+<p>
+You can obtain the <tt>headers</tt> namespace if case run-time
+modifications are required by running:
+</p>
+
+<pre class=example>
+-- loads the headers module
+local headers = require("headers")
+</pre>
+
+
<!-- bind ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=bind>
@@ -90,7 +114,7 @@ of connect are defined as simple helper functions that restrict the
<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=debug>
+<p class=name id=debug>
socket.<b>_DEBUG</b>
</p>
@@ -99,6 +123,19 @@ This constant is set to <tt><b>true</b></tt> if the library was compiled
with debug support.
</p>
+<!-- datagramsize +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=debug>
+socket.<b>_DATAGRAMSIZE</b>
+</p>
+
+<p class=description>
+Default datagram size used by calls to
+<a href="udp.html#receive"<tt>receive</tt></a> and
+<a href="udp.html#receivefrom"><tt>receivefrom</tt></a>.
+(Unless changed in compile time, the value is 8192.)
+</p>
+
<!-- get time +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=gettime>
@@ -106,8 +143,7 @@ socket.<b>gettime()</b>
</p>
<p class=description>
-Returns the time in seconds, relative to the origin of the
-universe. You should subtract the values returned by this function
+Returns the UNIX time in seconds. You should subtract the values returned by this function
to get meaningful values.
</p>
@@ -117,29 +153,6 @@ t = socket.gettime()
print(socket.gettime() - t .. " seconds elapsed")
</pre>
-<!-- socket.headers ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class=name id="headers.canonic">
-socket.headers.<b>canonic</b></p>
-
-<p> The <tt>socket.headers.canonic</tt> table
-is used by the HTTP and SMTP modules to translate from
-lowercase field names back into their canonic
-capitalization. When a lowercase field name exists as a key
-in this table, the associated value is substituted in
-whenever the field name is sent out.
-</p>
-
-<p>
-You can obtain the <tt>headers</tt> namespace if case run-time
-modifications are required by running:
-</p>
-
-<pre class=example>
--- loads the headers module
-local headers = require("headers")
-</pre>
-
<!-- newtry +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=newtry>
@@ -155,8 +168,7 @@ is raised.
<p class=parameters>
<tt>Finalizer</tt> is a function that will be called before
-<tt>try</tt> throws the exception. It will be called
-in <em>protected</em> mode.
+<tt>try</tt> throws the exception.
</p>
<p class=return>
@@ -204,15 +216,9 @@ to throw exceptions.
</p>
<p class=return>
-Returns an equivalent function that instead of throwing exceptions,
-returns <tt><b>nil</b></tt> followed by an error message.
-</p>
-
-<p class=note>
-Note: Beware that if your function performs some illegal operation that
-raises an error, the protected function will catch the error and return it
-as a string. This is because the <a href=#try><tt>try</tt></a> function
-uses errors as the mechanism to throw exceptions.
+Returns an equivalent function that instead of throwing exceptions in case of
+a failed <a href=#try><tt>try</tt></a> call, returns <tt><b>nil</b></tt>
+followed by an error message.
</p>
<!-- select +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -238,7 +244,9 @@ non-numeric indices) in the arrays will be silently ignored.
<p class=return> The function returns a list with the sockets ready for
reading, a list with the sockets ready for writing and an error message.
-The error message is "<tt>timeout</tt>" if a timeout condition was met and
+The error message is "<tt>timeout</tt>" if a timeout
+condition was met, "<tt>select failed</tt>" if the call
+to <tt>select</tt> failed, and
<tt><b>nil</b></tt> otherwise. The returned tables are
doubly keyed both by integers and also by the sockets
themselves, to simplify the test if a specific socket has
@@ -246,7 +254,7 @@ changed status.
</p>
<p class=note>
-<b>Note: </b>: <tt>select</tt> can monitor a limited number
+<b>Note:</b> <tt>select</tt> can monitor a limited number
of sockets, as defined by the constant <tt>socket._SETSIZE</tt>. This
number may be as high as 1024 or as low as 64 by default,
depending on the system. It is usually possible to change this
@@ -276,6 +284,18 @@ it to <tt>select</tt>, it will be ignored.
<b>Using select with non-socket objects</b>: Any object that implements <tt>getfd</tt> and <tt>dirty</tt> can be used with <tt>select</tt>, allowing objects from other libraries to be used within a <tt>socket.select</tt> driven loop.
</p>
+<!-- setsize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=setsize>
+socket.<b>_SETSIZE</b>
+</p>
+
+<p class=description>
+The maximum number of sockets that the <a
+href=#select><tt>select</tt></a> function can handle.
+</p>
+
+
<!-- sink ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=sink>
@@ -383,15 +403,14 @@ side closes the connection.
The function returns a source with the appropriate behavior.
</p>
-<!-- setsize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<!-- socketinvalid ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=setsize>
-socket.<b>_SETSIZE</b>
+<p class=name id=socketinvalid>
+socket.<b>_SOCKETINVALID</b>
</p>
<p class=description>
-The maximum number of sockets that the <a
-href=#select><tt>select</tt></a> function can handle.
+The OS value for an invalid socket.
</p>
<!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -401,9 +420,9 @@ socket.<b>try(</b>ret<sub>1</sub> [, ret<sub>2</sub> ... ret<sub>N</sub>]<b>)</b
</p>
<p class=description>
-Throws an exception in case of error. The exception can only be caught
-by the <a href=#protect><tt>protect</tt></a> function. It does not explode
-into an error message.
+Throws an exception in case <tt>ret<sub>1</sub></tt> is falsy, using
+<tt>ret<sub>2</sub></tt> as the error message. The exception is supposed to be caught
+by a <a href=#protect><tt>protect</tt></a>ed function only.
</p>
<p class=parameters>
@@ -414,7 +433,10 @@ nested with <tt>try</tt>.
<p class=return>
The function returns <tt>ret</tt><sub>1</sub> to <tt>ret</tt><sub>N</sub> if
-<tt>ret</tt><sub>1</sub> is not <tt><b>nil</b></tt>. Otherwise, it calls <tt>error</tt> passing <tt>ret</tt><sub>2</sub>.
+<tt>ret</tt><sub>1</sub> is not <tt><b>nil</b></tt> or <tt><b>false</b></tt>.
+Otherwise, it calls <tt>error</tt> passing <tt>ret</tt><sub>2</sub> wrapped
+in a table with metatable used by <a href=#protect><tt>protect</tt></a> to
+distinguish exceptions from runtime errors.
</p>
<pre class=example>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
index 151a4c993c1..c6c6eb26956 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
@@ -1,10 +1,10 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="description" content="LuaSocket: The TCP/IP support">
-<meta name="keywords" content="Lua, LuaSocket, Socket, TCP, Library, Network, Support">
+<meta name="keywords" content="Lua, LuaSocket, Socket, TCP, Library, Network, Support">
<title>LuaSocket: TCP/IP support</title>
<link rel="stylesheet" href="reference.css" type="text/css">
</head>
@@ -28,7 +28,7 @@
<a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot;
-<a href="reference.html">reference</a>
+<a href="reference.html">reference</a>
</p>
</center>
<hr>
@@ -36,56 +36,11 @@
<!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<h2 id="tcp">TCP</h2>
-
-<!-- socket.tcp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class=name id="socket.tcp">
-socket.<b>tcp()</b>
-</p>
-
-<p class=description>
-Creates and returns an IPv4 TCP master object. A master object can
-be transformed into a server object with the method
-<a href=#listen><tt>listen</tt></a> (after a call to <a
-href=#bind><tt>bind</tt></a>) or into a client object with
-the method <a href=#connect><tt>connect</tt></a>. The only other
-method supported by a master object is the
-<a href=#close><tt>close</tt></a> method.</p>
-
-<p class=return>
-In case of success, a new master object is returned. In case of error,
-<b><tt>nil</tt></b> is returned, followed by an error message.
-</p>
-
-<!-- socket.tcp6 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class=name id="socket.tcp6">
-socket.<b>tcp6()</b>
-</p>
-
-<p class=description>
-Creates and returns an IPv6 TCP master object. A master object can
-be transformed into a server object with the method
-<a href=#listen><tt>listen</tt></a> (after a call to <a
-href=#bind><tt>bind</tt></a>) or into a client object with
-the method <a href=#connect><tt>connect</tt></a>. The only other
-method supported by a master object is the
-<a href=#close><tt>close</tt></a> method.</p>
-
-<p class=return>
-In case of success, a new master object is returned. In case of error,
-<b><tt>nil</tt></b> is returned, followed by an error message.
-</p>
-
-<p class=note>
-Note: The TCP object returned will have the option
-"<tt>ipv6-v6only</tt>" set to <tt><b>true</b></tt>.
-</p>
+<h2 id="tcp">TCP</h2>
<!-- accept +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id="accept">
+<p class=name id="accept">
server:<b>accept()</b>
</p>
@@ -95,9 +50,9 @@ object and returns a client object representing that connection.
</p>
<p class=return>
-If a connection is successfully initiated, a client object is returned.
+If a connection is successfully initiated, a client object is returned.
If a timeout condition is met, the method returns <b><tt>nil</tt></b>
-followed by the error string '<tt>timeout</tt>'. Other errors are
+followed by the error string '<tt>timeout</tt>'. Other errors are
reported by <b><tt>nil</tt></b> followed by a message describing the error.
</p>
@@ -107,28 +62,28 @@ with a server object in
the <tt>recvt</tt> parameter before a call to <tt>accept</tt> does
<em>not</em> guarantee <tt>accept</tt> will return immediately. Use the <a
href=#settimeout><tt>settimeout</tt></a> method or <tt>accept</tt>
-might block until <em>another</em> client shows up.
+might block until <em>another</em> client shows up.
</p>
<!-- bind +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id="bind">
+<p class=name id="bind">
master:<b>bind(</b>address, port<b>)</b>
</p>
<p class=description>
Binds a master object to <tt>address</tt> and <tt>port</tt> on the
-local host.
+local host.
<p class=parameters>
-<tt>Address</tt> can be an IP address or a host name.
-<tt>Port</tt> must be an integer number in the range [0..64K).
+<tt>Address</tt> can be an IP address or a host name.
+<tt>Port</tt> must be an integer number in the range [0..64K).
If <tt>address</tt>
is '<tt>*</tt>', the system binds to all local interfaces
using the <tt>INADDR_ANY</tt> constant or
-<tt>IN6ADDR_ANY_INIT</tt>, according to the family.
+<tt>IN6ADDR_ANY_INIT</tt>, according to the family.
If <tt>port</tt> is 0, the system automatically
-chooses an ephemeral port.
+chooses an ephemeral port.
</p>
<p class=return>
@@ -137,13 +92,13 @@ method returns <b><tt>nil</tt></b> followed by an error message.
</p>
<p class=note>
-Note: The function <a href=socket.html#bind><tt>socket.bind</tt></a>
+Note: The function <a href=socket.html#bind><tt>socket.bind</tt></a>
is available and is a shortcut for the creation of server sockets.
</p>
<!-- close ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id="close">
+<p class=name id="close">
master:<b>close()</b><br>
client:<b>close()</b><br>
server:<b>close()</b>
@@ -154,14 +109,14 @@ Closes a TCP object. The internal socket used by the object is closed
and the local address to which the object was
bound is made available to other applications. No further operations
(except for further calls to the <tt>close</tt> method) are allowed on
-a closed socket.
+a closed socket.
</p>
<p class=note>
Note: It is important to close all used sockets once they are not
needed, since, in many systems, each socket uses a file descriptor,
which are limited system resources. Garbage-collected objects are
-automatically closed before destruction, though.
+automatically closed before destruction, though.
</p>
<!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -172,19 +127,19 @@ master:<b>connect(</b>address, port<b>)</b>
<p class=description>
Attempts to connect a master object to a remote host, transforming it into a
-client object.
-Client objects support methods
+client object.
+Client objects support methods
<a href=#send><tt>send</tt></a>,
-<a href=#receive><tt>receive</tt></a>,
-<a href=#getsockname><tt>getsockname</tt></a>,
+<a href=#receive><tt>receive</tt></a>,
+<a href=#getsockname><tt>getsockname</tt></a>,
<a href=#getpeername><tt>getpeername</tt></a>,
-<a href=#settimeout><tt>settimeout</tt></a>,
+<a href=#settimeout><tt>settimeout</tt></a>,
and <a href=#close><tt>close</tt></a>.
</p>
<p class=parameters>
-<tt>Address</tt> can be an IP address or a host name.
-<tt>Port</tt> must be an integer number in the range [1..64K).
+<tt>Address</tt> can be an IP address or a host name.
+<tt>Port</tt> must be an integer number in the range [1..64K).
</p>
<p class=return>
@@ -193,14 +148,14 @@ describing the error. In case of success, the method returns 1.
</p>
<p class=note>
-Note: The function <a href=socket.html#connect><tt>socket.connect</tt></a>
+Note: The function <a href=socket.html#connect><tt>socket.connect</tt></a>
is available and is a shortcut for the creation of client sockets.
</p>
<p class=note>
-Note: Starting with LuaSocket 2.0,
+Note: Starting with LuaSocket 2.0,
the <a href=#settimeout><tt>settimeout</tt></a>
-method affects the behavior of <tt>connect</tt>, causing it to return
+method affects the behavior of <tt>connect</tt>, causing it to return
with an error in case of a timeout. If that happens, you can still call <a
href=socket.html#select><tt>socket.select</tt></a> with the socket in the
<tt>sendt</tt> table. The socket will be writable when the connection is
@@ -208,14 +163,89 @@ established.
</p>
<p class=note>
-Note: Starting with LuaSocket 2.1, the host name resolution
-depends on whether the socket was created by <a
-href=#socket.tcp><tt>socket.tcp</tt></a> or <a
-href=#socket.tcp6><tt>socket.tcp6</tt></a>. Addresses from
-the appropriate family are tried in succession until the
-first success or until the last failure.
+Note: Starting with LuaSocket 3.0, the host name resolution
+depends on whether the socket was created by
+<a href=#socket.tcp><tt>socket.tcp</tt></a>,
+<a href=#socket.tcp4><tt>socket.tcp4</tt></a> or
+<a href=#socket.tcp6><tt>socket.tcp6</tt></a>. Addresses from
+the appropriate family (or both) are tried in the order
+returned by the resolver until the
+first success or until the last failure. If the timeout was
+set to zero, only the first address is tried.
+</p>
+
+<!-- dirty +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="dirty">
+master:<b>dirty()</b><br>
+client:<b>dirty()</b><br>
+server:<b>dirty()</b>
+</p>
+
+<p class=description>
+Check the read buffer status.
+</p>
+
+<p class=return>
+Returns <tt>true</tt> if there is any data in the read buffer, <tt>false</tt> otherwise.
+</p>
+
+<p class=note>
+Note: <b>This is an internal method, use at your own risk.</b>
+</p>
+
+
+<!-- getfd +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="getfd">
+master:<b>getfd()</b><br>
+client:<b>getfd()</b><br>
+server:<b>getfd()</b>
+</p>
+
+<p class=description>
+Returns the underling socket descriptor or handle associated to the object.
+</p>
+
+<p class=return>
+The descriptor or handle. In case the object has been closed, the return will be -1.
+</p>
+
+<p class=note>
+Note: <b>This is an internal method. Unlikely to be
+portable. Use at your own risk. </b>
+</p>
+
+
+<!-- getoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="getoption">
+client:<b>getoption(</b>option)</b><br>
+server:<b>getoption(</b>option)</b>
+</p>
+
+<p class=description>
+Gets options for the TCP object.
+See <a href=#setoption><tt>setoption</tt></a> for description of the
+option names and values.
+</p>
+
+<p class=parameters>
+<tt>Option</tt> is a string with the option name.
+<ul>
+
+<li> '<tt>keepalive</tt>'
+<li> '<tt>linger</tt>'
+<li> '<tt>reuseaddr</tt>'
+<li> '<tt>tcp-nodelay</tt>'
+</ul>
+
+<p class=return>
+The method returns the option <tt>value</tt> in case of success, or
+<b><tt>nil</tt></b> followed by an error message otherwise.
</p>
+
<!-- getpeername ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="getpeername">
@@ -227,10 +257,10 @@ Returns information about the remote side of a connected client object.
</p>
<p class=return>
-Returns a string with the IP address of the peer, the
-port number that peer is using for the connection,
-and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
-In case of error, the method returns <b><tt>nil</tt></b>.
+Returns a string with the IP address of the peer, the
+port number that peer is using for the connection,
+and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
+In case of error, the method returns <b><tt>nil</tt></b>.
</p>
<p class=note>
@@ -246,13 +276,13 @@ server:<b>getsockname()</b>
</p>
<p class=description>
-Returns the local address information associated to the object.
+Returns the local address information associated to the object.
</p>
<p class=return>
-The method returns a string with local IP address, a number with
-the local port,
-and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
+The method returns a string with local IP address, a number with
+the local port,
+and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
In case of error, the method returns <b><tt>nil</tt></b>.
</p>
@@ -266,32 +296,46 @@ server:<b>getstats()</b><br>
<p class=description>
Returns accounting information on the socket, useful for throttling
-of bandwidth.
+of bandwidth.
</p>
<p class=return>
The method returns the number of bytes received, the number of bytes sent,
-and the age of the socket object in seconds.
+and the age of the socket object in seconds.
</p>
+<!-- gettimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="gettimeout">
+master:<b>gettimeout()</b><br>
+client:<b>gettimeout()</b><br>
+server:<b>gettimeout()</b>
+</p>
+
+<p class=description>
+Returns the current block timeout followed by the curent
+total timeout.
+</p>
+
+
<!-- listen ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id="listen">
+<p class=name id="listen">
master:<b>listen(</b>backlog<b>)</b>
</p>
<p class=description>
Specifies the socket is willing to receive connections, transforming the
-object into a server object. Server objects support the
-<a href=#accept><tt>accept</tt></a>,
-<a href=#getsockname><tt>getsockname</tt></a>,
-<a href=#setoption><tt>setoption</tt></a>,
-<a href=#settimeout><tt>settimeout</tt></a>,
-and <a href=#close><tt>close</tt></a> methods.
+object into a server object. Server objects support the
+<a href=#accept><tt>accept</tt></a>,
+<a href=#getsockname><tt>getsockname</tt></a>,
+<a href=#setoption><tt>setoption</tt></a>,
+<a href=#settimeout><tt>settimeout</tt></a>,
+and <a href=#close><tt>close</tt></a> methods.
</p>
<p class=parameters>
-The parameter <tt>backlog</tt> specifies the number of client
+The parameter <tt>backlog</tt> specifies the number of client
connections that can
be queued waiting for service. If the queue is full and another client
attempts connection, the connection is refused.
@@ -310,11 +354,11 @@ client:<b>receive(</b>[pattern [, prefix]]<b>)</b>
<p class=description>
Reads data from a client object, according to the specified <em>read
-pattern</em>. Patterns follow the Lua file I/O format, and the difference in performance between all patterns is negligible.
+pattern</em>. Patterns follow the Lua file I/O format, and the difference in performance between all patterns is negligible.
</p>
<p class=parameters>
-<tt>Pattern</tt> can be any of the following:
+<tt>Pattern</tt> can be any of the following:
</p>
<ul>
@@ -325,7 +369,7 @@ terminated by a LF character (ASCII&nbsp;10), optionally preceded by a
CR character (ASCII&nbsp;13). The CR and LF characters are not included in
the returned line. In fact, <em>all</em> CR characters are
ignored by the pattern. This is the default pattern;
-<li> <tt>number</tt>: causes the method to read a specified <tt>number</tt>
+<li> <tt>number</tt>: causes the method to read a specified <tt>number</tt>
of bytes from the socket.
</ul>
@@ -347,10 +391,10 @@ closed before the transmission was completed or the string
<p class=note>
<b>Important note</b>: This function was changed <em>severely</em>. It used
to support multiple patterns (but I have never seen this feature used) and
-now it doesn't anymore. Partial results used to be returned in the same
+now it doesn't anymore. Partial results used to be returned in the same
way as successful results. This last feature violated the idea that all
functions should return <tt><b>nil</b></tt> on error. Thus it was changed
-too.
+too.
</p>
<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -366,7 +410,7 @@ Sends <tt>data</tt> through client object.
<p class=parameters>
<tt>Data</tt> is the string to be sent. The optional arguments
<tt>i</tt> and <tt>j</tt> work exactly like the standard
-<tt>string.sub</tt> Lua function to allow the selection of a
+<tt>string.sub</tt> Lua function to allow the selection of a
substring to be sent.
</p>
@@ -385,10 +429,10 @@ there was a timeout during the operation.
</p>
<p class=note>
-Note: Output is <em>not</em> buffered. For small strings,
-it is always better to concatenate them in Lua
-(with the '<tt>..</tt>' operator) and send the result in one call
-instead of calling the method several times.
+Note: Output is <em>not</em> buffered. For small strings,
+it is always better to concatenate them in Lua
+(with the '<tt>..</tt>' operator) and send the result in one call
+instead of calling the method several times.
</p>
<!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -400,12 +444,12 @@ server:<b>setoption(</b>option [, value]<b>)</b>
<p class=description>
Sets options for the TCP 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.
+time-critical applications. You should only modify an option if you
+are sure you need it.
</p>
<p class=parameters>
-<tt>Option</tt> is a string with the option name, and <tt>value</tt>
+<tt>Option</tt> is a string with the option name, and <tt>value</tt>
depends on the option being set:
<ul>
@@ -413,7 +457,7 @@ depends on the option being set:
<li> '<tt>keepalive</tt>': Setting this option to <tt>true</tt> enables
the periodic transmission of messages on a connected socket. Should the
connected party fail to respond to these messages, the connection is
-considered broken and processes using the socket are notified;
+considered broken and processes using the socket are notified;
<li> '<tt>linger</tt>': Controls the action taken when unsent data are
queued on a socket and a close is performed. The value is a table with a
@@ -424,13 +468,13 @@ it is able to transmit the data or until '<tt>timeout</tt>' has passed. If
'<tt>on</tt>' is <tt>false</tt> and a close is issued, the system will
process the close in a manner that allows the process to continue as
quickly as possible. I do not advise you to set this to anything other than
-zero;
+zero;
<li> '<tt>reuseaddr</tt>': Setting this option indicates that the rules
-used in validating addresses supplied in a call to
+used in validating addresses supplied in a call to
<a href=#bind><tt>bind</tt></a> should allow reuse of local addresses;
-<li> '<tt>tcp-nodelay</tt>': Setting this option to <tt>true</tt>
+<li> '<tt>tcp-nodelay</tt>': Setting this option to <tt>true</tt>
disables the Nagle's algorithm for the connection;
<li> '<tt>ipv6-v6only</tt>':
@@ -447,34 +491,6 @@ followed by an error message otherwise.
Note: The descriptions above come from the man pages.
</p>
-<!-- getoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class=name id="getoption">
-client:<b>getoption(</b>option)</b><br>
-server:<b>getoption(</b>option)</b>
-</p>
-
-<p class=description>
-Gets options for the TCP object.
-See <a href=#setoption><tt>setoption</tt></a> for description of the
-option names and values.
-</p>
-
-<p class=parameters>
-<tt>Option</tt> is a string with the option name.
-<ul>
-
-<li> '<tt>keepalive</tt>'
-<li> '<tt>linger</tt>'
-<li> '<tt>reuseaddr</tt>'
-<li> '<tt>tcp-nodelay</tt>'
-</ul>
-
-<p class=return>
-The method returns the option <tt>value</tt> in case of success, or
-<b><tt>nil</tt></b> followed by an error message otherwise.
-</p>
-
<!-- setstats +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="setstats">
@@ -485,7 +501,7 @@ server:<b>setstats(</b>received, sent, age<b>)</b><br>
<p class=description>
Resets accounting information on the socket, useful for throttling
-of bandwidth.
+of bandwidth.
</p>
<p class=parameters>
@@ -495,7 +511,7 @@ of bandwidth.
</p>
<p class=return>
-The method returns 1 in case of success and <tt><b>nil</b></tt> otherwise.
+The method returns 1 in case of success and <tt><b>nil</b></tt> otherwise.
</p>
<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -509,8 +525,8 @@ server:<b>settimeout(</b>value [, mode]<b>)</b>
<p class=description>
Changes the timeout values for the object. By default,
all I/O operations are blocking. That is, any call to the methods
-<a href=#send><tt>send</tt></a>,
-<a href=#receive><tt>receive</tt></a>, and
+<a href=#send><tt>send</tt></a>,
+<a href=#receive><tt>receive</tt></a>, and
<a href=#accept><tt>accept</tt></a>
will block indefinitely, until the operation completes. The
<tt>settimeout</tt> method defines a limit on the amount of time the
@@ -521,7 +537,7 @@ time has elapsed, the affected methods give up and fail with an error code.
<p class=parameters>
The amount of time to wait is specified as the
<tt>value</tt> parameter, in seconds. There are two timeout modes and
-both can be used together for fine tuning:
+both can be used together for fine tuning:
</p>
<ul>
@@ -532,7 +548,7 @@ default mode;</li>
<li> '<tt>t</tt>': <em>total</em> timeout. Specifies the upper limit on
the amount of time LuaSocket can block a Lua script before returning from
-a call.</li>
+a call.</li>
</ul>
<p class=parameters>
@@ -562,7 +578,7 @@ client:<b>shutdown(</b>mode<b>)</b><br>
</p>
<p class=description>
-Shuts down part of a full-duplex connection.
+Shuts down part of a full-duplex connection.
</p>
<p class=parameters>
@@ -579,66 +595,107 @@ This is the default mode;
This function returns 1.
</p>
-<!-- dirty +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<!-- setfd +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id="dirty">
-master:<b>dirty()</b><br>
-client:<b>dirty()</b><br>
-server:<b>dirty()</b>
+<p class=name id="setfd">
+master:<b>setfd(</b>fd<b>)</b><br>
+client:<b>setfd(</b>fd<b>)</b><br>
+server:<b>setfd(</b>fd<b>)</b>
</p>
<p class=description>
-Check the read buffer status.
+Sets the underling socket descriptor or handle associated to the object. The current one is simply replaced, not closed, and no other change to the object state is made.
</p>
<p class=return>
-Returns <tt>true</tt> if there is any data in the read buffer, <tt>false</tt> otherwise.
+No return value.
</p>
<p class=note>
-Note: <b>This is an internal method, any use is unlikely to be portable.</b>
+Note: <b>This is an internal method. Unlikely to be
+portable. Use at your own risk. </b>
</p>
-<!-- getfd +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<!-- socket.tcp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id="getfd">
-master:<b>getfd()</b><br>
-client:<b>getfd()</b><br>
-server:<b>getfd()</b>
+<p class=name id="socket.tcp">
+socket.<b>tcp()</b>
</p>
<p class=description>
-Returns the underling socket descriptor or handle associated to the object.
-</p>
+Creates and returns an TCP master object. A master object can
+be transformed into a server object with the method
+<a href=#listen><tt>listen</tt></a> (after a call to <a
+href=#bind><tt>bind</tt></a>) or into a client object with
+the method <a href=#connect><tt>connect</tt></a>. The only other
+method supported by a master object is the
+<a href=#close><tt>close</tt></a> method.</p>
<p class=return>
-The descriptor or handle. In case the object has been closed, the return will be -1.
+In case of success, a new master object is returned. In case of error,
+<b><tt>nil</tt></b> is returned, followed by an error message.
</p>
<p class=note>
-Note: <b>This is an internal method, any use is unlikely to be portable.</b>
+Note: The choice between IPv4 and IPv6 happens during a call to
+<a href=#bind><tt>bind</tt></a> or <a
+href=#bind><tt>connect</tt></a>, depending on the address
+family obtained from the resolver.
</p>
-<!-- setfd +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<p class=note>
+Note: Before the choice between IPv4 and IPv6 happens,
+the internal socket object is invalid and therefore <a
+href=#setoption><tt>setoption</tt></a> will fail.
+</p>
-<p class=name id="setfd">
-master:<b>setfd(</b>fd<b>)</b><br>
-client:<b>setfd(</b>fd<b>)</b><br>
-server:<b>setfd(</b>fd<b>)</b>
+<!-- socket.tcp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="socket.tcp4">
+socket.<b>tcp4()</b>
</p>
<p class=description>
-Sets the underling socket descriptor or handle associated to the object. The current one is simply replaced, not closed, and no other change to the object state is made.
+Creates and returns an IPv4 TCP master object. A master object can
+be transformed into a server object with the method
+<a href=#listen><tt>listen</tt></a> (after a call to <a
+href=#bind><tt>bind</tt></a>) or into a client object with
+the method <a href=#connect><tt>connect</tt></a>. The only other
+method supported by a master object is the
+<a href=#close><tt>close</tt></a> method.</p>
+
+<p class=return>
+In case of success, a new master object is returned. In case of error,
+<b><tt>nil</tt></b> is returned, followed by an error message.
+</p>
+
+<!-- socket.tcp6 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="socket.tcp6">
+socket.<b>tcp6()</b>
</p>
+<p class=description>
+Creates and returns an IPv6 TCP master object. A master object can
+be transformed into a server object with the method
+<a href=#listen><tt>listen</tt></a> (after a call to <a
+href=#bind><tt>bind</tt></a>) or into a client object with
+the method <a href=#connect><tt>connect</tt></a>. The only other
+method supported by a master object is the
+<a href=#close><tt>close</tt></a> method.</p>
+
<p class=return>
-No return value.
+In case of success, a new master object is returned. In case of error,
+<b><tt>nil</tt></b> is returned, followed by an error message.
</p>
<p class=note>
-Note: <b>This is an internal method, any use is unlikely to be portable.</b>
+Note: The TCP object returned will have the option
+"<tt>ipv6-v6only</tt>" set to <tt><b>true</b></tt>.
</p>
+
+
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<div class=footer>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html
index 554fa317688..4618aadb97e 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html
@@ -4,7 +4,7 @@
<head>
<meta name="description" content="LuaSocket: The UDP support">
-<meta name="keywords" content="Lua, LuaSocket, Socket, UDP, Library, Network, Support">
+<meta name="keywords" content="Lua, LuaSocket, Socket, UDP, Library, Network, Support">
<title>LuaSocket: UDP support</title>
<link rel="stylesheet" href="reference.css" type="text/css">
</head>
@@ -28,7 +28,7 @@
<a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot;
-<a href="reference.html">reference</a>
+<a href="reference.html">reference</a>
</p>
</center>
<hr>
@@ -37,74 +37,7 @@
<!-- udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<h2 id="udp">UDP</h2>
-
-<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class="name" id="socket.udp">
-socket.<b>udp()</b>
-</p>
-
-<p class="description">
-Creates and returns an unconnected IPv4 UDP object.
-Unconnected objects support the
-<a href="#sendto"><tt>sendto</tt></a>,
-<a href="#receive"><tt>receive</tt></a>,
-<a href="#receivefrom"><tt>receivefrom</tt></a>,
-<a href="#getoption"><tt>getoption</tt></a>,
-<a href="#getsockname"><tt>getsockname</tt></a>,
-<a href="#setoption"><tt>setoption</tt></a>,
-<a href="#settimeout"><tt>settimeout</tt></a>,
-<a href="#setpeername"><tt>setpeername</tt></a>,
-<a href="#setsockname"><tt>setsockname</tt></a>, and
-<a href="#close"><tt>close</tt></a>.
-The <a href="#setpeername"><tt>setpeername</tt></a>
-is used to connect the object.
-</p>
-
-<p class="return">
-In case of success, a new unconnected UDP object
-returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
-an error message.
-</p>
-
-<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class="name" id="socket.udp6">
-socket.<b>udp6()</b>
-</p>
-
-<p class="description">
-Creates and returns an unconnected IPv6 UDP object.
-Unconnected objects support the
-<a href="#sendto"><tt>sendto</tt></a>,
-<a href="#receive"><tt>receive</tt></a>,
-<a href="#receivefrom"><tt>receivefrom</tt></a>,
-<a href="#getoption"><tt>getoption</tt></a>,
-<a href="#getsockname"><tt>getsockname</tt></a>,
-<a href="#setoption"><tt>setoption</tt></a>,
-<a href="#settimeout"><tt>settimeout</tt></a>,
-<a href="#setpeername"><tt>setpeername</tt></a>,
-<a href="#setsockname"><tt>setsockname</tt></a>, and
-<a href="#close"><tt>close</tt></a>.
-The <a href="#setpeername"><tt>setpeername</tt></a>
-is used to connect the object.
-</p>
-
-<p class="return">
-In case of success, a new unconnected UDP object
-returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
-an error message.
-</p>
-
-<p class=note>
-Note: The TCP object returned will have the option
-"<tt>ipv6-v6only</tt>" set to <tt><b>true</b></tt>.
-</p>
-
-
-
-<!-- close +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<h2 id="udp">UDP</h2>
<!-- close +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -129,6 +62,40 @@ Garbage-collected objects are automatically closed before
destruction, though.
</p>
+<!-- getoption +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="getoption">
+connected:<b>getoption()</b><br>
+unconnected:<b>getoption()</b>
+</p>
+
+<p class="description">
+Gets an option value from the UDP object.
+See <a href=#setoption><tt>setoption</tt></a> for
+description of the option names and values.
+</p>
+
+<p class="parameters"><tt>Option</tt> is a string with the option name.
+<ul>
+<li> '<tt>dontroute</tt>'
+<li> '<tt>broadcast</tt>'
+<li> '<tt>reuseaddr</tt>'
+<li> '<tt>reuseport</tt>'
+<li> '<tt>ip-multicast-loop</tt>'
+<li> '<tt>ipv6-v6only</tt>'
+<li> '<tt>ip-multicast-if</tt>'
+<li> '<tt>ip-multicast-ttl</tt>'
+<li> '<tt>ip-add-membership</tt>'
+<li> '<tt>ip-drop-membership</tt>'
+</ul>
+</p>
+
+<p class=return>
+The method returns the option <tt>value</tt> in case of
+success, or
+<b><tt>nil</tt></b> followed by an error message otherwise.
+</p>
+
<!-- getpeername +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class="name" id="getpeername">
@@ -142,10 +109,10 @@ associated with a connected UDP object.
<p class=return>
-Returns a string with the IP address of the peer, the
-port number that peer is using for the connection,
-and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
-In case of error, the method returns <b><tt>nil</tt></b>.
+Returns a string with the IP address of the peer, the
+port number that peer is using for the connection,
+and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
+In case of error, the method returns <b><tt>nil</tt></b>.
</p>
<p class="note">
@@ -165,9 +132,9 @@ Returns the local address information associated to the object.
<p class=return>
-The method returns a string with local IP address, a number with
-the local port,
-and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
+The method returns a string with local IP address, a number with
+the local port,
+and a string with the family ("<tt>inet</tt>" or "<tt>inet6</tt>").
In case of error, the method returns <b><tt>nil</tt></b>.
</p>
@@ -179,6 +146,18 @@ first time (in which case it is bound to an ephemeral port and the
wild-card address).
</p>
+<!-- gettimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="gettimeout">
+connected:<b>settimeout(</b>value<b>)</b><br>
+unconnected:<b>settimeout(</b>value<b>)</b>
+</p>
+
+<p class=description>
+Returns the current timeout value.
+</p>
+
+
<!-- receive +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class="name" id="receive">
@@ -199,9 +178,12 @@ specifies the maximum size of the datagram to be retrieved. If
there are more than <tt>size</tt> bytes available in the datagram,
the excess bytes are discarded. If there are less then
<tt>size</tt> bytes available in the current datagram, the
-available bytes are returned. If <tt>size</tt> is omitted, the
-maximum datagram size is used (which is currently limited by the
-implementation to 8192 bytes).
+available bytes are returned.
+If <tt>size</tt> is omitted, the
+compile-time constant <a
+href=socket.html#datagramsize><tt>socket._DATAGRAMSIZE</tt></a> is used
+(it defaults to 8192 bytes). Larger sizes will cause a
+temporary buffer to be allocated for the operation.
</p>
<p class="return">
@@ -217,46 +199,12 @@ unconnected:<b>receivefrom(</b>[size]<b>)</b>
</p>
<p class="description">
-Works exactly as the <a href="#receive"><tt>receive</tt></a>
+Works exactly as the <a href="#receive"><tt>receive</tt></a>
method, except it returns the IP
address and port as extra return values (and is therefore slightly less
efficient).
</p>
-<!-- getoption +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class="name" id="getoption">
-connected:<b>getoption()</b><br>
-unconnected:<b>getoption()</b>
-</p>
-
-<p class="description">
-Gets an option value from the UDP object.
-See <a href=#setoption><tt>setoption</tt></a> for
-description of the option names and values.
-</p>
-
-<p class="parameters"><tt>Option</tt> is a string with the option name.
-<ul>
-<li> '<tt>dontroute</tt>'
-<li> '<tt>broadcast</tt>'
-<li> '<tt>reuseaddr</tt>'
-<li> '<tt>reuseport</tt>'
-<li> '<tt>ip-multicast-loop</tt>'
-<li> '<tt>ipv6-v6only</tt>'
-<li> '<tt>ip-multicast-if</tt>'
-<li> '<tt>ip-multicast-ttl</tt>'
-<li> '<tt>ip-add-membership</tt>'
-<li> '<tt>ip-drop-membership</tt>'
-</ul>
-</p>
-
-<p class=return>
-The method returns the option <tt>value</tt> in case of
-success, or
-<b><tt>nil</tt></b> followed by an error message otherwise.
-</p>
-
<!-- send ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class="name" id="send">
@@ -268,7 +216,7 @@ Sends a datagram to the UDP peer of a connected object.
</p>
<p class="parameters">
-<tt>Datagram</tt> is a string with the datagram contents.
+<tt>Datagram</tt> is a string with the datagram contents.
The maximum datagram size for UDP is 64K minus IP layer overhead.
However datagrams larger than the link layer packet size will be
fragmented, which may deteriorate performance and/or reliability.
@@ -298,11 +246,11 @@ Sends a datagram to the specified IP address and port number.
<p class="parameters">
<tt>Datagram</tt> is a string with the
-datagram contents.
+datagram contents.
The maximum datagram size for UDP is 64K minus IP layer overhead.
However datagrams larger than the link layer packet size will be
fragmented, which may deteriorate performance and/or reliability.
-<tt>Ip</tt> is the IP address of the recipient.
+<tt>Ip</tt> is the IP address of the recipient.
Host names are <em>not</em> allowed for performance reasons.
<tt>Port</tt> is the port number at the recipient.
@@ -320,6 +268,75 @@ refuses to send a message to the specified address (i.e. no
interface accepts the address).
</p>
+<!-- setoption +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="setoption">
+connected:<b>setoption(</b>option [, value]<b>)</b><br>
+unconnected:<b>setoption(</b>option [, value]<b>)</b>
+</p>
+
+<p class="description">
+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.</p>
+<p class="parameters"><tt>Option</tt> is a string with the option
+name, and <tt>value</tt> depends on the option being set:
+</p>
+
+<ul>
+<li> '<tt>dontroute</tt>': Indicates that outgoing
+messages should bypass the standard routing facilities.
+Receives a boolean value;
+<li> '<tt>broadcast</tt>': Requests permission to send
+broadcast datagrams on the socket.
+Receives a boolean value;
+<li> '<tt>reuseaddr</tt>': Indicates that the rules used in
+validating addresses supplied in a <tt>bind()</tt> call
+should allow reuse of local addresses.
+Receives a boolean value;
+<li> '<tt>reuseport</tt>': Allows completely duplicate
+bindings by multiple processes if they all set
+'<tt>reuseport</tt>' before binding the port.
+Receives a boolean value;
+<li> '<tt>ip-multicast-loop</tt>':
+Specifies whether or not a copy of an outgoing multicast
+datagram is delivered to the sending host as long as it is a
+member of the multicast group.
+Receives a boolean value;
+<li> '<tt>ipv6-v6only</tt>':
+Specifies whether to restrict <tt>inet6</tt> sockets to
+sending and receiving only IPv6 packets.
+Receive a boolean value;
+<li> '<tt>ip-multicast-if</tt>':
+Sets the interface over which outgoing multicast datagrams
+are sent.
+Receives an IP address;
+<li> '<tt>ip-multicast-ttl</tt>':
+Sets the Time To Live in the IP header for outgoing
+multicast datagrams.
+Receives a number;
+<li> '<tt>ip-add-membership</tt>':
+Joins the multicast group specified.
+Receives a table with fields
+<tt>multiaddr</tt> and <tt>interface</tt>, each containing an
+IP address;
+<li> '<tt>ip-drop-membership</tt>': Leaves the multicast
+group specified.
+Receives a table with fields
+<tt>multiaddr</tt> and <tt>interface</tt>, each containing an
+IP address.
+</ul>
+
+<p class="return">
+The method returns 1 in case of success, or
+<b><tt>nil</tt></b> followed by an error message otherwise.
+</p>
+
+<p class=note>
+Note: The descriptions above come from the man pages.
+</p>
+
+
<!-- setpeername +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class="name" id="setpeername">
@@ -337,9 +354,9 @@ object or vice versa.
For connected objects, outgoing datagrams
will be sent to the specified peer, and datagrams received from
other peers will be discarded by the OS. Connected UDP objects must
-use the <a href="#send"><tt>send</tt></a> and
-<a href="#receive"><tt>receive</tt></a> methods instead of
-<a href="#sendto"><tt>sendto</tt></a> and
+use the <a href="#send"><tt>send</tt></a> and
+<a href="#receive"><tt>receive</tt></a> methods instead of
+<a href="#sendto"><tt>sendto</tt></a> and
<a href="#receivefrom"><tt>receivefrom</tt></a>.
</p>
@@ -365,7 +382,7 @@ and can result in up to 30% performance gains.
</p>
<p class=note>
-Note: Starting with LuaSocket 2.1, the host name resolution
+Note: Starting with LuaSocket 3.0, the host name resolution
depends on whether the socket was created by <a
href=#socket.udp><tt>socket.udp</tt></a> or <a
href=#socket.udp6><tt>socket.udp6</tt></a>. Addresses from
@@ -406,74 +423,6 @@ system or explicitly by <tt>setsockname</tt>, it cannot be
changed.
</p>
-<!-- setoption +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
-<p class="name" id="setoption">
-connected:<b>setoption(</b>option [, value]<b>)</b><br>
-unconnected:<b>setoption(</b>option [, value]<b>)</b>
-</p>
-
-<p class="description">
-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.</p>
-<p class="parameters"><tt>Option</tt> is a string with the option
-name, and <tt>value</tt> depends on the option being set:
-</p>
-
-<ul>
-<li> '<tt>dontroute</tt>': Indicates that outgoing
-messages should bypass the standard routing facilities.
-Receives a boolean value;
-<li> '<tt>broadcast</tt>': Requests permission to send
-broadcast datagrams on the socket.
-Receives a boolean value;
-<li> '<tt>reuseaddr</tt>': Indicates that the rules used in
-validating addresses supplied in a <tt>bind()</tt> call
-should allow reuse of local addresses.
-Receives a boolean value;
-<li> '<tt>reuseport</tt>': Allows completely duplicate
-bindings by multiple processes if they all set
-'<tt>reuseport</tt>' before binding the port.
-Receives a boolean value;
-<li> '<tt>ip-multicast-loop</tt>':
-Specifies whether or not a copy of an outgoing multicast
-datagram is delivered to the sending host as long as it is a
-member of the multicast group.
-Receives a boolean value;
-<li> '<tt>ipv6-v6only</tt>':
-Specifies whether to restrict <tt>inet6</tt> sockets to
-sending and receiving only IPv6 packets.
-Receive a boolean value;
-<li> '<tt>ip-multicast-if</tt>':
-Sets the interface over which outgoing multicast datagrams
-are sent.
-Receives an IP address;
-<li> '<tt>ip-multicast-ttl</tt>':
-Sets the Time To Live in the IP header for outgoing
-multicast datagrams.
-Receives a number;
-<li> '<tt>ip-add-membership</tt>':
-Joins the multicast group specified.
-Receives a table with fields
-<tt>multiaddr</tt> and <tt>interface</tt>, each containing an
-IP address;
-<li> '<tt>ip-drop-membership</tt>': Leaves the multicast
-group specified.
-Receives a table with fields
-<tt>multiaddr</tt> and <tt>interface</tt>, each containing an
-IP address.
-</ul>
-
-<p class="return">
-The method returns 1 in case of success, or
-<b><tt>nil</tt></b> followed by an error message otherwise.
-</p>
-
-<p class=note>
-Note: The descriptions above come from the man pages.
-</p>
-
<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class="name" id="settimeout">
@@ -482,14 +431,14 @@ unconnected:<b>settimeout(</b>value<b>)</b>
</p>
<p class="description">
-Changes the timeout values for the object. By default, the
-<a href="#receive"><tt>receive</tt></a> and
-<a href="#receivefrom"><tt>receivefrom</tt></a>
+Changes the timeout values for the object. By default, the
+<a href="#receive"><tt>receive</tt></a> and
+<a href="#receivefrom"><tt>receivefrom</tt></a>
operations are blocking. That is, any call to the methods will block
indefinitely, until data arrives. The <tt>settimeout</tt> function defines
a limit on the amount of time the functions can block. When a timeout is
set and the specified amount of time has elapsed, the affected methods
-give up and fail with an error code.
+give up and fail with an error code.
</p>
<p class="parameters">
@@ -514,6 +463,114 @@ all other method names already contained verbs making their
imperative nature obvious.
</p>
+<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="socket.udp">
+socket.<b>udp()</b>
+</p>
+
+<p class="description">
+Creates and returns an unconnected UDP object.
+Unconnected objects support the
+<a href="#sendto"><tt>sendto</tt></a>,
+<a href="#receive"><tt>receive</tt></a>,
+<a href="#receivefrom"><tt>receivefrom</tt></a>,
+<a href="#getoption"><tt>getoption</tt></a>,
+<a href="#getsockname"><tt>getsockname</tt></a>,
+<a href="#setoption"><tt>setoption</tt></a>,
+<a href="#settimeout"><tt>settimeout</tt></a>,
+<a href="#setpeername"><tt>setpeername</tt></a>,
+<a href="#setsockname"><tt>setsockname</tt></a>, and
+<a href="#close"><tt>close</tt></a>.
+The <a href="#setpeername"><tt>setpeername</tt></a>
+is used to connect the object.
+</p>
+
+<p class="return">
+In case of success, a new unconnected UDP object
+returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
+an error message.
+</p>
+
+<p class=note>
+Note: The choice between IPv4 and IPv6 happens during a call to
+<a href=#sendto><tt>sendto</tt></a>, <a
+href=#setpeername><tt>setpeername</tt></a>, or <a
+href=#setsockname><tt>sockname</tt></a>, depending on the address
+family obtained from the resolver.
+</p>
+
+<p class=note>
+Note: Before the choice between IPv4 and IPv6 happens,
+the internal socket object is invalid and therefore <a
+href=#setoption><tt>setoption</tt></a> will fail.
+</p>
+
+<!-- socket.udp4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="socket.udp">
+socket.<b>udp4()</b>
+</p>
+
+<p class="description">
+Creates and returns an unconnected IPv4 UDP object.
+Unconnected objects support the
+<a href="#sendto"><tt>sendto</tt></a>,
+<a href="#receive"><tt>receive</tt></a>,
+<a href="#receivefrom"><tt>receivefrom</tt></a>,
+<a href="#getoption"><tt>getoption</tt></a>,
+<a href="#getsockname"><tt>getsockname</tt></a>,
+<a href="#setoption"><tt>setoption</tt></a>,
+<a href="#settimeout"><tt>settimeout</tt></a>,
+<a href="#setpeername"><tt>setpeername</tt></a>,
+<a href="#setsockname"><tt>setsockname</tt></a>, and
+<a href="#close"><tt>close</tt></a>.
+The <a href="#setpeername"><tt>setpeername</tt></a>
+is used to connect the object.
+</p>
+
+<p class="return">
+In case of success, a new unconnected UDP object
+returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
+an error message.
+</p>
+
+<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="socket.udp6">
+socket.<b>udp6()</b>
+</p>
+
+<p class="description">
+Creates and returns an unconnected IPv6 UDP object.
+Unconnected objects support the
+<a href="#sendto"><tt>sendto</tt></a>,
+<a href="#receive"><tt>receive</tt></a>,
+<a href="#receivefrom"><tt>receivefrom</tt></a>,
+<a href="#getoption"><tt>getoption</tt></a>,
+<a href="#getsockname"><tt>getsockname</tt></a>,
+<a href="#setoption"><tt>setoption</tt></a>,
+<a href="#settimeout"><tt>settimeout</tt></a>,
+<a href="#setpeername"><tt>setpeername</tt></a>,
+<a href="#setsockname"><tt>setsockname</tt></a>, and
+<a href="#close"><tt>close</tt></a>.
+The <a href="#setpeername"><tt>setpeername</tt></a>
+is used to connect the object.
+</p>
+
+<p class="return">
+In case of success, a new unconnected UDP object
+returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
+an error message.
+</p>
+
+<p class=note>
+Note: The TCP object returned will have the option
+"<tt>ipv6-v6only</tt>" set to <tt><b>true</b></tt>.
+</p>
+
+
+
<!-- footer ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<div class=footer>
@@ -524,7 +581,7 @@ imperative nature obvious.
<a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot;
-<a href="reference.html">reference</a>
+<a href="reference.html">reference</a>
</p>
<p>
<small>