diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-15 06:24:00 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-15 06:24:00 +0000 |
commit | 58096449c6044b7aade5cd41cfd71c6bec1d273d (patch) | |
tree | 1814ffebe89c4c2556d84f97f66db37a7e8b4554 /doc/socket.html | |
parent | 9ed7f955e5fc69af9bf1794fa2c8cd227981ba24 (diff) | |
download | luasocket-58096449c6044b7aade5cd41cfd71c6bec1d273d.tar.gz luasocket-58096449c6044b7aade5cd41cfd71c6bec1d273d.tar.bz2 luasocket-58096449c6044b7aade5cd41cfd71c6bec1d273d.zip |
Manual is almost done. HTTP is missing.
Implemented new distribution scheme.
Select is now purely C.
HTTP reimplemented seems faster dunno why.
LTN12 functions that coroutines fail gracefully.
Diffstat (limited to 'doc/socket.html')
-rw-r--r-- | doc/socket.html | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/doc/socket.html b/doc/socket.html index bde882b..eccc676 100644 --- a/doc/socket.html +++ b/doc/socket.html | |||
@@ -36,16 +36,13 @@ | |||
36 | <h2 id=socket>The socket namespace</h2> | 36 | <h2 id=socket>The socket namespace</h2> |
37 | 37 | ||
38 | <p> | 38 | <p> |
39 | The <tt>socket</tt> namespace contains the namespace tables for all | 39 | The <tt>socket</tt> namespace contains the core functionality of LuaSocket. |
40 | LuaSocket modules as well as function that didn't belong in any specific | ||
41 | module, functions that are so commonly used that deserve a shortcut and a | ||
42 | few constants. | ||
43 | </p> | 40 | </p> |
44 | 41 | ||
45 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 42 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
46 | 43 | ||
47 | <p class=name id=debug> | 44 | <p class=name id=debug> |
48 | socket.<b>debug</b> | 45 | socket.<b>DEBUG</b> |
49 | </p> | 46 | </p> |
50 | 47 | ||
51 | <p class=description> | 48 | <p class=description> |
@@ -57,7 +54,7 @@ with debug support. | |||
57 | <!-- protect +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 54 | <!-- protect +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
58 | 55 | ||
59 | <p class=name id=protect> | 56 | <p class=name id=protect> |
60 | socket.<b>protect(</b>function<b>)</b> | 57 | socket.<b>protect(</b>func<b>)</b> |
61 | </p> | 58 | </p> |
62 | 59 | ||
63 | <p class=description> | 60 | <p class=description> |
@@ -65,12 +62,12 @@ Converts a function that throws exceptions into a safe function. | |||
65 | </p> | 62 | </p> |
66 | 63 | ||
67 | <p class=parameters> | 64 | <p class=parameters> |
68 | <tt>Function</tt> is a function that calls | 65 | <tt>Funct</tt> is a function that calls |
69 | <a href=#try><tt>try</tt></a> to throw exceptions. | 66 | <a href=#try><tt>try</tt></a> to throw exceptions. |
70 | </p> | 67 | </p> |
71 | 68 | ||
72 | <p class=return> | 69 | <p class=return> |
73 | The function an equivalent function that instead of throwing exceptoins, | 70 | Returns an equivalent function that instead of throwing exceptions, |
74 | returns <tt><b>nil</b></tt> followed by an error message. | 71 | returns <tt><b>nil</b></tt> followed by an error message. |
75 | </p> | 72 | </p> |
76 | 73 | ||
@@ -103,16 +100,16 @@ simplify the test if a specific socket has changed status. | |||
103 | </p> | 100 | </p> |
104 | 101 | ||
105 | <p class=note> | 102 | <p class=note> |
106 | <b>Important Note</b>: a known bug in WinSock causes <tt>select</tt> to fail | 103 | <b>Important note</b>: a known bug in WinSock causes <tt>select</tt> to fail |
107 | on non-blocking TCP sockets. The function may return a socket as | 104 | on non-blocking TCP sockets. The function may return a socket as |
108 | writable even though the socket is <em>not</em> ready for sending. | 105 | writable even though the socket is <em>not</em> ready for sending. |
109 | </p> | 106 | </p> |
110 | 107 | ||
111 | <p class=note> | 108 | <p class=note> |
112 | <b>Important note</b>: calling select with a server socket in the receive | 109 | <b>Another important note</b>: calling select with a server socket in the receive |
113 | parameter before a call to accept does <em>not</em> guarantee | 110 | parameter before a call to accept does <em>not</em> guarantee |
114 | <a href=tcp.html#accept><tt>accept</tt></a> will return immediately. | 111 | <a href=tcp.html#accept><tt>accept</tt></a> will return immediately. |
115 | Use the <a href=tcp.html#timeout><tt>timeout</tt></a> | 112 | Use the <a href=tcp.html#settimeout><tt>settimeout</tt></a> |
116 | method or <tt>accept</tt> might block forever. | 113 | method or <tt>accept</tt> might block forever. |
117 | </p> | 114 | </p> |
118 | 115 | ||
@@ -131,7 +128,7 @@ socket.<b>sink(</b>mode, socket<b>)</b> | |||
131 | 128 | ||
132 | <p class=description> | 129 | <p class=description> |
133 | Creates an | 130 | Creates an |
134 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN012</a> | 131 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> |
135 | sink from a stream socket object. | 132 | sink from a stream socket object. |
136 | </p> | 133 | </p> |
137 | 134 | ||
@@ -163,7 +160,7 @@ socket.<b>source(</b>mode, socket [, length]<b>)</b> | |||
163 | 160 | ||
164 | <p class=description> | 161 | <p class=description> |
165 | Creates an | 162 | Creates an |
166 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN012</a> | 163 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> |
167 | source from a stream socket object. | 164 | source from a stream socket object. |
168 | </p> | 165 | </p> |
169 | 166 | ||
@@ -217,7 +214,7 @@ c = socket.try(socket.connect("localhost", 80)) | |||
217 | <!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 214 | <!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
218 | 215 | ||
219 | <p class=name id=version> | 216 | <p class=name id=version> |
220 | socket.<b>version</b> | 217 | socket.<b>VERSION</b> |
221 | </p> | 218 | </p> |
222 | 219 | ||
223 | <p class=description> | 220 | <p class=description> |