aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-24 20:29:28 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-24 20:29:28 +0000
commit96da86a81f0f37961851ead62404c255293eebdf (patch)
treec8c118109360b6d4696c5535f7b902301909e802
parent7dace4af7e2f0235a49fa64b47b13c50691baddb (diff)
downloadluasocket-96da86a81f0f37961851ead62404c255293eebdf.tar.gz
luasocket-96da86a81f0f37961851ead62404c255293eebdf.tar.bz2
luasocket-96da86a81f0f37961851ead62404c255293eebdf.zip
Simplified documentation of send().
-rw-r--r--doc/tcp.html39
1 files changed, 11 insertions, 28 deletions
diff --git a/doc/tcp.html b/doc/tcp.html
index 5814e1a..39fa6b7 100644
--- a/doc/tcp.html
+++ b/doc/tcp.html
@@ -331,34 +331,17 @@ substring to be sent.
331</p> 331</p>
332 332
333<p class=return> 333<p class=return>
334If successful, the method returns the number of bytes sent. 334If successful, the method returns the index of the last byte
335In case of error, the method returns 335within <tt>[i, j]</tt> that has been sent. Notice that, if
336<b><tt>nil</tt></b>, followed by an error message, followed by the 336<tt>i</tt> is 1 or absent, this is effectively the total
337index of the first character within <tt>[i, j]</tt> that has not been sent yet 337number of bytes sent. In case of error, the method returns
338(you might want to try again from then on). The error message can be '<tt>closed</tt>' in case 338<b><tt>nil</tt></b>, followed by an error message, followed
339the connection was closed before the transmission was completed or the 339by the index of the last byte within <tt>[i, j]</tt> that
340string '<tt>timeout</tt>' in case there was a timeout during the 340has been sent. You might want to try again from the byte
341operation. 341following that. The error message can be '<tt>closed</tt>'
342</p> 342in case the connection was closed before the transmission
343 343was completed or the string '<tt>timeout</tt>' in case
344<p class=note> 344there was a timeout during the operation.
345<b>Important note</b>:
346The return values for the <tt>send</tt> method have been changed in
347LuaSocket 2.0 alpha <b>and again</b> in the beta (sorry)!
348In previous versions, the method returned only the
349error message. Since returning <b><tt>nil</tt></b> in case of success was
350nonsense, in alpha the first return value became the number of bytes sent.
351Alas, it wasn't returning <tt><b>nil</b></tt> in case of
352error. So it was changed again in beta.
353</p>
354
355<p class=note>
356<b>Also important</b>:
357In order to better support non-blocking I/O and to discourage
358bad practice, the <tt>send</tt> method now only sends one string
359per call. The other optional arguments allow the user to select
360a substring to be sent in a much more efficient way than
361using <tt>string.sub</tt>.
362</p> 345</p>
363 346
364<p class=note> 347<p class=note>