aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/introduction.html2
-rw-r--r--doc/tcp.html35
2 files changed, 29 insertions, 8 deletions
diff --git a/doc/introduction.html b/doc/introduction.html
index 6468148..20c4d36 100644
--- a/doc/introduction.html
+++ b/doc/introduction.html
@@ -113,7 +113,7 @@ The core LuaSocket is almost entirely implemented in C. It is
113usually available as a dynamic library which the interpreter can load 113usually available as a dynamic library which the interpreter can load
114with the help of a loader module written in Lua. 114with the help of a loader module written in Lua.
115Beginning with version 2.0 and following the Lua 5.0 trend, all LuaSocket 115Beginning with version 2.0 and following the Lua 5.0 trend, all LuaSocket
116functionality is defined inside tables (or rather a namespaces). No global 116functionality is defined inside tables (or rather namespaces). No global
117variables are ever created. 117variables are ever created.
118Namespaces are obtained with the <tt>require</tt> Lua function, which loads 118Namespaces are obtained with the <tt>require</tt> Lua function, which loads
119and initializes any required library and returns the namespace. 119and initializes any required library and returns the namespace.
diff --git a/doc/tcp.html b/doc/tcp.html
index 5f520e9..30e06f4 100644
--- a/doc/tcp.html
+++ b/doc/tcp.html
@@ -260,7 +260,7 @@ method returns <b><tt>nil</tt></b> followed by an error message.
260<!-- receive ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 260<!-- receive ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
261 261
262<p class=name id=receive> 262<p class=name id=receive>
263client:<b>receive(</b>[pattern]<b>)</b> 263client:<b>receive(</b>[pattern [, prefix]]<b>)</b>
264</p> 264</p>
265 265
266<p class=description> 266<p class=description>
@@ -283,6 +283,11 @@ the returned line. This is the default pattern;
283of bytes from the socket. 283of bytes from the socket.
284</ul> 284</ul>
285 285
286<p class=parameters>
287<tt>Prefix</tt> is an optional string to be concatenated to the beginning
288of any received data before return.
289</p>
290
286<p class=return> 291<p class=return>
287If successful, the method returns the received pattern. In case of error, 292If successful, the method returns the received pattern. In case of error,
288the method returns <tt><b>nil</b></tt> followed by an error message which 293the method returns <tt><b>nil</b></tt> followed by an error message which
@@ -305,18 +310,18 @@ too.
305<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 310<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
306 311
307<p class=name id=send> 312<p class=name id=send>
308client:<b>send(</b>string<sub>1</sub> [, 313client:<b>send(</b>data [, i [, j]]<b>)</b>
309string<sub>2</sub>, ... string<sub>N</sub>]<b>)</b>
310</p> 314</p>
311 315
312<p class=description> 316<p class=description>
313Sends data through client object. 317Sends <tt>data</tt> through client object.
314</p> 318</p>
315 319
316<p class=parameters> 320<p class=parameters>
317All parameters should be strings. For small strings, it is always better to 321<tt>Data</tt> is the string to be sent. The optional arguments
318concatenate them in Lua (with the '<tt>..</tt>' operator) and pass the 322<tt>i</tt> and <tt>j</tt> work exactly like the standard
319result to LuaSocket instead of passing several independent strings. 323<tt>string.sub</tt> Lua function to allow the selection of a
324substring to be sent.
320</p> 325</p>
321 326
322<p class=return> 327<p class=return>
@@ -341,6 +346,22 @@ Alas, it wasn't returning <tt><b>nil</b></tt> in case of
341error. So it was changed again in beta. 346error. So it was changed again in beta.
342</p> 347</p>
343 348
349<p class=note>
350<b>Also important</b>:
351In order to better support non-blocking I/O and to discourage
352bad practice, the <tt>send</tt> method now only sends one string
353per call. The other optional arguments allow the user to select
354a substring to be sent in a much more efficient way than
355using <tt>string.sub</tt>.
356</p>
357
358<p class=note>
359Note: Output is <em>not</em> buffered. For small strings,
360it is always better to concatenate them in Lua
361(with the '<tt>..</tt>' operator) and send the result in one call
362instead of calling the method several times.
363</p>
364
344<!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 365<!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
345 366
346<p class=name id=setoption> 367<p class=name id=setoption>