Document dirty, getfd, and setfd for select and tcp.

This commit is contained in:
Sam Roberts 2011-10-24 11:24:58 -07:00
parent 3a0fd4744d
commit 12bde801f6
3 changed files with 67 additions and 0 deletions

View File

@ -170,12 +170,15 @@ Support, Manual">
<a href="tcp.html#bind">bind</a>, <a href="tcp.html#bind">bind</a>,
<a href="tcp.html#close">close</a>, <a href="tcp.html#close">close</a>,
<a href="tcp.html#connect">connect</a>, <a href="tcp.html#connect">connect</a>,
<a href="tcp.html#dirty">dirty</a>,
<a href="tcp.html#getfd">getfd</a>,
<a href="tcp.html#getpeername">getpeername</a>, <a href="tcp.html#getpeername">getpeername</a>,
<a href="tcp.html#getsockname">getsockname</a>, <a href="tcp.html#getsockname">getsockname</a>,
<a href="tcp.html#getstats">getstats</a>, <a href="tcp.html#getstats">getstats</a>,
<a href="tcp.html#listen">listen</a>, <a href="tcp.html#listen">listen</a>,
<a href="tcp.html#receive">receive</a>, <a href="tcp.html#receive">receive</a>,
<a href="tcp.html#send">send</a>, <a href="tcp.html#send">send</a>,
<a href="tcp.html#setfd">setfd</a>,
<a href="tcp.html#setoption">setoption</a>, <a href="tcp.html#setoption">setoption</a>,
<a href="tcp.html#setstats">setstats</a>, <a href="tcp.html#setstats">setstats</a>,
<a href="tcp.html#settimeout">settimeout</a>, <a href="tcp.html#settimeout">settimeout</a>,

View File

@ -217,6 +217,10 @@ method or <tt>accept</tt> might block forever.
it to <tt>select</tt>, it will be ignored. it to <tt>select</tt>, it will be ignored.
</p> </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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- sink ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id=sink> <p class=name id=sink>

View File

@ -507,6 +507,66 @@ This is the default mode;
This function returns 1. This function returns 1.
</p> </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 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<div class=footer> <div class=footer>