moonbridge

diff reference.txt @ 43:f2efab1ba3d0

Methods :close(), :cancel(), and :readuntil(...) do not throw I/O errors but return error message as second return value after nil
author jbe
date Mon Mar 09 16:42:55 2015 +0100 (2015-03-09)
parents 2d7e3028d993
children e835cda61478
line diff
     1.1 --- a/reference.txt	Sun Mar 08 01:09:28 2015 +0100
     1.2 +++ b/reference.txt	Mon Mar 09 16:42:55 2015 +0100
     1.3 @@ -31,7 +31,9 @@
     1.4  ### socket:cancel()
     1.5  
     1.6  Closes the socket connection by sending a TCP RST package if possible to
     1.7 -indicate error condition.
     1.8 +indicate error condition. Returns true on success, or nil plus error message in
     1.9 +case of an I/O error. Using this method on sockets that have already been
    1.10 +closed (or canceled) will throw an error.
    1.11  
    1.12  Warning: Previously sent (and flushed) data may be lost during transmission.
    1.13  
    1.14 @@ -39,8 +41,9 @@
    1.15  ### socket:close(timeout)
    1.16  
    1.17  Closes the socket connection (input and output stream) by flushing all data and
    1.18 -sending a TCP FIN package. Performs no operation if stream has already been
    1.19 -closed.
    1.20 +sending a TCP FIN package. Returns true on success, or nil plus error message
    1.21 +in case of an I/O error. Using this method on sockets that have already been
    1.22 +closed (or canceled) will throw an error.
    1.23  
    1.24  Warning: Pending data on the input stream may cause connection aborts (TCP RST)
    1.25  depending on the particular operating system used. All pending input data
    1.26 @@ -106,10 +109,12 @@
    1.27  
    1.28  Reads as many bytes until a byte equal to the terminator value occurs. An
    1.29  optional maximum length may be specified. The terminating byte is included in
    1.30 -the return value (unless the maximum length would be exceeded).
    1.31 +the return value (unless the maximum length would be exceeded). On EOF, nil is
    1.32 +returned. In case of an I/O error, nil (as first result value) plus an error
    1.33 +message (as second result value) is returned.
    1.34  
    1.35 -Also available as :readuntil(...) method for any other Lua file handle
    1.36 -(including socket.input)
    1.37 +This method is also available as :readuntil(...) for any other Lua file handle
    1.38 +(including socket.input).
    1.39  
    1.40  
    1.41  ### socket.remote_ip4

Impressum / About Us