diff options
Diffstat (limited to 'doc/tcp.html')
| -rw-r--r-- | doc/tcp.html | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/doc/tcp.html b/doc/tcp.html index 781ec6f..cd417a5 100644 --- a/doc/tcp.html +++ b/doc/tcp.html | |||
| @@ -277,9 +277,10 @@ the transmission. | |||
| 277 | <p class=note> | 277 | <p class=note> |
| 278 | <b>Important note</b>: This function was changed <em>severely</em>. It used | 278 | <b>Important note</b>: This function was changed <em>severely</em>. It used |
| 279 | to support multiple patterns (but I have never seen this feature used) and | 279 | to support multiple patterns (but I have never seen this feature used) and |
| 280 | partial results used to be returned in the same way as successful results. | 280 | now it doesn't anymore. Partial results used to be returned in the same |
| 281 | This last feature violated the idea that all functions should return | 281 | way as successful results. This last feature violated the idea that all |
| 282 | <tt><b>nil</b></tt> on error. Thus the change. | 282 | functions should return <tt><b>nil</b></tt> on error. Thus it was changed |
| 283 | too. | ||
| 283 | </p> | 284 | </p> |
| 284 | 285 | ||
| 285 | <!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 286 | <!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
| @@ -300,20 +301,25 @@ result to LuaSocket instead of passing several independent strings. | |||
| 300 | </p> | 301 | </p> |
| 301 | 302 | ||
| 302 | <p class=return> | 303 | <p class=return> |
| 303 | The method returns the number of bytes accepted by the transport layer, | 304 | If successful, the method returns the number of bytes accepted by |
| 304 | followed by an error code. The error code is <b><tt>nil</tt></b> if the operation | 305 | the transport layer. In case of error, the method returns |
| 305 | completed with no errors, the string '<tt>closed</tt>' in case | 306 | <b><tt>nil</tt></b>, followed by an error message, followed by the |
| 307 | partial number of bytes accepted by the transport layer. | ||
| 308 | The error message can be '<tt>closed</tt>' in case | ||
| 306 | the connection was closed before the transmission was completed or the | 309 | the connection was closed before the transmission was completed or the |
| 307 | string '<tt>timeout</tt>' in case there was a timeout during the | 310 | string '<tt>timeout</tt>' in case there was a timeout during the |
| 308 | operation. | 311 | operation. |
| 309 | </p> | 312 | </p> |
| 310 | 313 | ||
| 311 | <p class=note> | 314 | <p class=note> |
| 312 | Note: The return values for the <tt>send</tt> method have been changed in | 315 | <b>Important note</b>: |
| 313 | LuaSocket 2.0! In previous versions, the method returned only the | 316 | The return values for the <tt>send</tt> method have been changed in |
| 314 | error message. Since returning <b><tt>nil</tt></b> in case of success goes | 317 | LuaSocket 2.0 alpha <b>and again</b> in the beta (sorry)! |
| 315 | against all other LuaSocket methods and functions, the | 318 | In previous versions, the method returned only the |
| 316 | <tt>send</tt> method been changed for the sake of uniformity. | 319 | error message. Since returning <b><tt>nil</tt></b> in case of success was |
| 320 | nonsense, in alpha the first return value became the number of bytes sent. | ||
| 321 | Alas, it wasn't returning <tt><b>nil</b></tt> in case of | ||
| 322 | error. So it was changed again in beta. | ||
| 317 | </p> | 323 | </p> |
| 318 | 324 | ||
| 319 | <!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 325 | <!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
