aboutsummaryrefslogtreecommitdiff
path: root/doc/socket.html
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2009-05-27 09:31:38 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2009-05-27 09:31:38 +0000
commitbce60be30fe8e9c1b0eb33128c23c93d7bca5303 (patch)
tree3927343c777fcb7764a0f2f89754a0ceab141c21 /doc/socket.html
parentd1a72435d5bd3528f3c334cd4d1da16dcead47bf (diff)
downloadluasocket-bce60be30fe8e9c1b0eb33128c23c93d7bca5303.tar.gz
luasocket-bce60be30fe8e9c1b0eb33128c23c93d7bca5303.tar.bz2
luasocket-bce60be30fe8e9c1b0eb33128c23c93d7bca5303.zip
Decent makefiles!
Diffstat (limited to 'doc/socket.html')
-rw-r--r--doc/socket.html56
1 files changed, 38 insertions, 18 deletions
diff --git a/doc/socket.html b/doc/socket.html
index f096e4b..490ab50 100644
--- a/doc/socket.html
+++ b/doc/socket.html
@@ -24,8 +24,8 @@
24</td></tr> 24</td></tr>
25</table> 25</table>
26<p class=bar> 26<p class=bar>
27<a href="home.html">home</a> &middot; 27<a href="index.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 28<a href="index.html#download">download</a> &middot;
29<a href="installation.html">installation</a> &middot; 29<a href="installation.html">installation</a> &middot;
30<a href="introduction.html">introduction</a> &middot; 30<a href="introduction.html">introduction</a> &middot;
31<a href="reference.html">reference</a> 31<a href="reference.html">reference</a>
@@ -94,6 +94,24 @@ This constant is set to <tt><b>true</b></tt> if the library was compiled
94with debug support. 94with debug support.
95</p> 95</p>
96 96
97<!-- get time +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
98
99<p class=name id=gettime>
100socket.<b>gettime()</b>
101</p>
102
103<p class=description>
104Returns the time in seconds, relative to the origin of the
105universe. You should subtract the values returned by this function
106to get meaningful values.
107</p>
108
109<pre class=example>
110t = socket.gettime()
111-- do stuff
112print(socket.gettime() - t .. " seconds elapsed")
113</pre>
114
97<!-- newtry +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 115<!-- newtry +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
98 116
99<p class=name id=newtry> 117<p class=name id=newtry>
@@ -200,6 +218,15 @@ changed status.
200</p> 218</p>
201 219
202<p class=note> 220<p class=note>
221<b>Note: </b>: <tt>select</tt> can monitor a limited number
222of sockets, as defined by the constant <tt>socket._SETSIZE</tt>. This
223number may be as high as 1024 or as low as 64 by default,
224depending on the system. It is usually possible to change this
225at compile time. Invoking <tt>select</tt> with a larger
226number of sockets will raise an error.
227</p>
228
229<p class=note>
203<b>Important note</b>: a known bug in WinSock causes <tt>select</tt> to fail 230<b>Important note</b>: a known bug in WinSock causes <tt>select</tt> to fail
204on non-blocking TCP sockets. The function may return a socket as 231on non-blocking TCP sockets. The function may return a socket as
205writable even though the socket is <em>not</em> ready for sending. 232writable even though the socket is <em>not</em> ready for sending.
@@ -288,8 +315,8 @@ Freezes the program execution during a given amount of time.
288</p> 315</p>
289 316
290<p class=parameters> 317<p class=parameters>
291<tt>Time</tt> is the number of seconds to sleep for. 318<tt>Time</tt> is the number of seconds to sleep for. If
292The function truncates <tt>time</tt> down to the nearest integer. 319<tt>time</tt> is negative, the function returns immediately.
293</p> 320</p>
294 321
295<!-- source +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 322<!-- source +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -324,24 +351,17 @@ side closes the connection.
324The function returns a source with the appropriate behavior. 351The function returns a source with the appropriate behavior.
325</p> 352</p>
326 353
327<!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 354<!-- setsize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
328 355
329<p class=name id=gettime> 356<p class=name id=setsize>
330socket.<b>gettime()</b> 357socket.<b>_SETSIZE</b>
331</p> 358</p>
332 359
333<p class=description> 360<p class=description>
334Returns the time in seconds, relative to the origin of the 361The maximum number of sockets that the <a
335universe. You should subtract the values returned by this function 362href=#select><tt>select</tt></a> function can handle.
336to get meaningful values.
337</p> 363</p>
338 364
339<pre class=example>
340t = socket.gettime()
341-- do stuff
342print(socket.gettime() - t .. " seconds elapsed")
343</pre>
344
345<!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 365<!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
346 366
347<p class=name id=try> 367<p class=name id=try>
@@ -386,8 +406,8 @@ This constant has a string describing the current LuaSocket version.
386<hr> 406<hr>
387<center> 407<center>
388<p class=bar> 408<p class=bar>
389<a href="home.html">home</a> &middot; 409<a href="index.html">home</a> &middot;
390<a href="home.html#down">download</a> &middot; 410<a href="index.html#down">download</a> &middot;
391<a href="installation.html">installation</a> &middot; 411<a href="installation.html">installation</a> &middot;
392<a href="introduction.html">introduction</a> &middot; 412<a href="introduction.html">introduction</a> &middot;
393<a href="reference.html">reference</a> 413<a href="reference.html">reference</a>