summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html')
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html195
1 files changed, 163 insertions, 32 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
index a16a09ed538..151a4c993c1 100644
--- a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.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>
@@ -36,16 +36,16 @@
<!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<h2 id=tcp>TCP</h2>
+<h2 id="tcp">TCP</h2>
<!-- socket.tcp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=socket.tcp>
+<p class=name id="socket.tcp">
socket.<b>tcp()</b>
</p>
<p class=description>
-Creates and returns a TCP master object. A master object can
+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
@@ -58,9 +58,34 @@ 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>
+
<!-- accept +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=accept>
+<p class=name id="accept">
server:<b>accept()</b>
</p>
@@ -87,7 +112,7 @@ might block until <em>another</em> client shows up.
<!-- bind +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=bind>
+<p class=name id="bind">
master:<b>bind(</b>address, port<b>)</b>
</p>
@@ -100,7 +125,9 @@ local host.
<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. If <tt>port</tt> is 0, the system automatically
+using the <tt>INADDR_ANY</tt> constant or
+<tt>IN6ADDR_ANY_INIT</tt>, according to the family.
+If <tt>port</tt> is 0, the system automatically
chooses an ephemeral port.
</p>
@@ -116,7 +143,7 @@ is available and is a shortcut for the creation of server sockets.
<!-- 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>
@@ -139,7 +166,7 @@ automatically closed before destruction, though.
<!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=connect>
+<p class=name id="connect">
master:<b>connect(</b>address, port<b>)</b>
</p>
@@ -180,9 +207,18 @@ href=socket.html#select><tt>socket.select</tt></a> with the socket in the
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.
+</p>
+
<!-- getpeername ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=getpeername>
+<p class=name id="getpeername">
client:<b>getpeername()</b>
</p>
@@ -191,8 +227,9 @@ 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, followed by the
-port number that peer is using for the connection.
+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>
@@ -202,7 +239,7 @@ Note: It makes no sense to call this method on server objects.
<!-- getsockname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=getsockname>
+<p class=name id="getsockname">
master:<b>getsockname()</b><br>
client:<b>getsockname()</b><br>
server:<b>getsockname()</b>
@@ -213,13 +250,15 @@ Returns the local address information associated to the object.
</p>
<p class=return>
-The method returns a string with local IP address and a number with
-the port. In case of error, the method returns <b><tt>nil</tt></b>.
+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>
<!-- getstats +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=getstats>
+<p class=name id="getstats">
master:<b>getstats()</b><br>
client:<b>getstats()</b><br>
server:<b>getstats()</b><br>
@@ -237,7 +276,7 @@ and the age of the socket object in seconds.
<!-- listen ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=listen>
+<p class=name id="listen">
master:<b>listen(</b>backlog<b>)</b>
</p>
@@ -265,7 +304,7 @@ method returns <b><tt>nil</tt></b> followed by an error message.
<!-- receive ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=receive>
+<p class=name id="receive">
client:<b>receive(</b>[pattern [, prefix]]<b>)</b>
</p>
@@ -297,12 +336,12 @@ of any received data before return.
<p class=return>
If successful, the method returns the received pattern. In case of error,
-the method returns <tt><b>nil</b></tt> followed by an error message which
-can be the string '<tt>closed</tt>' in case the connection was
+the method returns <tt><b>nil</b></tt> followed by an error
+message, followed by a (possibly empty) string containing
+the partial that was received. The error message can be
+the string '<tt>closed</tt>' in case the connection was
closed before the transmission was completed or the string
'<tt>timeout</tt>' in case there was a timeout during the operation.
-Also, after the error message, the function returns the partial result of
-the transmission.
</p>
<p class=note>
@@ -316,7 +355,7 @@ too.
<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=send>
+<p class=name id="send">
client:<b>send(</b>data [, i [, j]]<b>)</b>
</p>
@@ -354,7 +393,7 @@ instead of calling the method several times.
<!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=setoption>
+<p class=name id="setoption">
client:<b>setoption(</b>option [, value]<b>)</b><br>
server:<b>setoption(</b>option [, value]<b>)</b>
</p>
@@ -392,21 +431,53 @@ 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>
-disables the Nagle's algorithm for the connection.
+disables the Nagle's algorithm for the connection;
+<li> '<tt>ipv6-v6only</tt>':
+Setting this option to <tt>true</tt> restricts an <tt>inet6</tt> socket to
+sending and receiving only IPv6 packets.
</ul>
<p class=return>
-The method returns 1 in case of success, or <b><tt>nil</tt></b> otherwise.
+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>
+<!-- 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>
+<p class=name id="setstats">
master:<b>setstats(</b>received, sent, age<b>)</b><br>
client:<b>setstats(</b>received, sent, age<b>)</b><br>
server:<b>setstats(</b>received, sent, age<b>)</b><br>
@@ -429,7 +500,7 @@ The method returns 1 in case of success and <tt><b>nil</b></tt> otherwise.
<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=settimeout>
+<p class=name id="settimeout">
master:<b>settimeout(</b>value [, mode]<b>)</b><br>
client:<b>settimeout(</b>value [, mode]<b>)</b><br>
server:<b>settimeout(</b>value [, mode]<b>)</b>
@@ -486,7 +557,7 @@ contained verbs making their imperative nature obvious.
<!-- shutdown +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-<p class=name id=shutdown>
+<p class=name id="shutdown">
client:<b>shutdown(</b>mode<b>)</b><br>
</p>
@@ -508,14 +579,74 @@ This is the default mode;
This function returns 1.
</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, any use is unlikely to be portable.</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, any use is unlikely to be portable.</b>
+</p>
+
+<!-- setfd +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<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>
+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>
+No return value.
+</p>
+
+<p class=note>
+Note: <b>This is an internal method, any use is unlikely to be portable.</b>
+</p>
+
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<div class=footer>
<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>