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.html118
1 files changed, 70 insertions, 48 deletions
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>