diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-20 22:19:54 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-20 22:19:54 +0000 |
| commit | f7579db9e830ef41f422a280d26c9077f48728e5 (patch) | |
| tree | d96affac7f5e8203d2e9c4a053213a992cd76650 /doc/socket.html | |
| parent | 5dc5c3ebe8f111bba01762ca0f5edba912c4f0b9 (diff) | |
| download | luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.tar.gz luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.tar.bz2 luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.zip | |
Fixing bugs...
Diffstat (limited to 'doc/socket.html')
| -rw-r--r-- | doc/socket.html | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/doc/socket.html b/doc/socket.html index 4d77478..1bbeb7f 100644 --- a/doc/socket.html +++ b/doc/socket.html | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | <center> | 16 | <center> |
| 17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
| 18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
| 19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
| 20 | </a></td></tr> | 20 | </a></td></tr> |
| 21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
| 22 | </td></tr> | 22 | </td></tr> |
| @@ -48,6 +48,27 @@ To obtain the <tt>socket</tt> namespace, run: | |||
| 48 | local socket = require("socket") | 48 | local socket = require("socket") |
| 49 | </pre> | 49 | </pre> |
| 50 | 50 | ||
| 51 | <!-- bind ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
| 52 | |||
| 53 | <p class=name id=bind> | ||
| 54 | socket.<b>bind(</b>address, port [, backlog]<b>)</b> | ||
| 55 | </p> | ||
| 56 | |||
| 57 | <p class=description> | ||
| 58 | </p> | ||
| 59 | |||
| 60 | <!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
| 61 | |||
| 62 | <p class=name id=connect> | ||
| 63 | socket.<b>connect(</b>address, port [, locaddr, locport]<b>)</b> | ||
| 64 | </p> | ||
| 65 | |||
| 66 | <p class=description> | ||
| 67 | This function is a shortcut that creates and returns a TCP socket object | ||
| 68 | connected to a remote <tt>host</tt> at a given <tt>port</tt>. Optionally, | ||
| 69 | the use can also specify the local address and port to bind | ||
| 70 | (<tt>locaddr</tt> and </tt>locport</tt>). | ||
| 71 | </p> | ||
| 51 | 72 | ||
| 52 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 73 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
| 53 | 74 | ||
| @@ -289,8 +310,8 @@ The function returns a source with the appropriate behavior. | |||
| 289 | 310 | ||
| 290 | <!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 311 | <!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
| 291 | 312 | ||
| 292 | <p class=name id=time> | 313 | <p class=name id=gettime> |
| 293 | socket.<b>time()</b> | 314 | socket.<b>gettime()</b> |
| 294 | </p> | 315 | </p> |
| 295 | 316 | ||
| 296 | <p class=description> | 317 | <p class=description> |
| @@ -304,9 +325,9 @@ The function returns the time as a number. | |||
| 304 | </p> | 325 | </p> |
| 305 | 326 | ||
| 306 | <pre class=example> | 327 | <pre class=example> |
| 307 | t = socket.time() | 328 | t = socket.gettime() |
| 308 | -- do stuff | 329 | -- do stuff |
| 309 | print(socket.time() - t .. " seconds elapsed") | 330 | print(socket.gettime() - t .. " seconds elapsed") |
| 310 | </pre> | 331 | </pre> |
| 311 | 332 | ||
| 312 | <!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 333 | <!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
