summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html')
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html93
1 files changed, 73 insertions, 20 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
index ba4b7303e32..b9303cb505a 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
@@ -24,8 +24,8 @@
</td></tr>
</table>
<p class=bar>
-<a href="home.html">home</a> &middot;
-<a href="home.html#download">download</a> &middot;
+<a href="index.html">home</a> &middot;
+<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>
@@ -73,14 +73,19 @@ set to <tt><b>true</b></tt>.
<!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=connect>
-socket.<b>connect(</b>address, port [, locaddr, locport]<b>)</b>
+socket.<b>connect[46](</b>address, port [, locaddr] [, locport] [, family]<b>)</b>
</p>
<p class=description>
This function is a shortcut that creates and returns a TCP client object
-connected to a remote <tt>host</tt> at a given <tt>port</tt>. Optionally,
+connected to a remote <tt>address</tt> at a given <tt>port</tt>. Optionally,
the user can also specify the local address and port to bind
-(<tt>locaddr</tt> and <tt>locport</tt>).
+(<tt>locaddr</tt> and <tt>locport</tt>), or restrict the socket family
+to "<tt>inet</tt>" or "<tt>inet6</tt>".
+Without specifying <tt>family</tt> to <tt>connect</tt>, whether a tcp or tcp6
+connection is created depends on your system configuration. Two variations
+of connect are defined as simple helper functions that restrict the
+<tt>family</tt>, <tt>socket.connect4</tt> and <tt>socket.connect6</tt>.
</p>
<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -94,6 +99,47 @@ This constant is set to <tt><b>true</b></tt> if the library was compiled
with debug support.
</p>
+<!-- get time +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=gettime>
+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
+to get meaningful values.
+</p>
+
+<pre class=example>
+t = socket.gettime()
+-- do stuff
+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>
@@ -200,6 +246,15 @@ changed status.
</p>
<p class=note>
+<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
+at compile time. Invoking <tt>select</tt> with a larger
+number of sockets will raise an error.
+</p>
+
+<p class=note>
<b>Important note</b>: a known bug in WinSock causes <tt>select</tt> to fail
on non-blocking TCP sockets. The function may return a socket as
writable even though the socket is <em>not</em> ready for sending.
@@ -217,6 +272,10 @@ method or <tt>accept</tt> might block forever.
it to <tt>select</tt>, it will be ignored.
</p>
+<p class=note>
+<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>
+
<!-- sink ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=sink>
@@ -288,7 +347,8 @@ Freezes the program execution during a given amount of time.
</p>
<p class=parameters>
-<tt>Time</tt> is the number of seconds to sleep for.
+<tt>Time</tt> is the number of seconds to sleep for. If
+<tt>time</tt> is negative, the function returns immediately.
</p>
<!-- source +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -323,24 +383,17 @@ side closes the connection.
The function returns a source with the appropriate behavior.
</p>
-<!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<!-- setsize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=gettime>
-socket.<b>gettime()</b>
+<p class=name id=setsize>
+socket.<b>_SETSIZE</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
-to get meaningful values.
+The maximum number of sockets that the <a
+href=#select><tt>select</tt></a> function can handle.
</p>
-<pre class=example>
-t = socket.gettime()
--- do stuff
-print(socket.gettime() - t .. " seconds elapsed")
-</pre>
-
<!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=try>
@@ -385,8 +438,8 @@ This constant has a string describing the current LuaSocket version.
<hr>
<center>
<p class=bar>
-<a href="home.html">home</a> &middot;
-<a href="home.html#down">download</a> &middot;
+<a href="index.html">home</a> &middot;
+<a href="index.html#down">download</a> &middot;
<a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a>