moonbridge
diff reference.txt @ 77:38e7bd13200d
Use write instead of fwrite for non-blocking I/O
author | jbe |
---|---|
date | Sun Apr 05 01:17:06 2015 +0200 (2015-04-05) |
parents | 88541c2aab4d |
children | 0ec070d6f5d9 |
line diff
1.1 --- a/reference.txt Sun Apr 05 00:35:11 2015 +0200 1.2 +++ b/reference.txt Sun Apr 05 01:17:06 2015 +0200 1.3 @@ -57,7 +57,8 @@ 1.4 1.5 Alternatively to file descriptors, the tables may contain file handles, in 1.6 which case the file descriptor is automatically extracted from the file handle 1.7 -and the file handle's buffer is additionally tested for pending data. 1.8 +and, in case of waiting for reading, the file handle's buffer is additionally 1.9 +tested for pending data. 1.10 1.11 Please note that support for non-blocking I/O operations is limited if you use 1.12 ordinary file handles (as Moonbridge does). It is possible, however, to wait 1.13 @@ -194,6 +195,11 @@ 1.14 In case of an I/O error, nil (as first result value) and an error message (as 1.15 second result value) are returned. 1.16 1.17 +Note: Using this method will automatically flush any unflushed data written 1.18 +through previous socket.output:write(...) calls. Thus, if any data was 1.19 +previously written in a blocking fashion and has not been flushed, then the 1.20 +socket.output:write_nb(...) call may block. 1.21 + 1.22 This method is also available for any other Lua file handle. 1.23 1.24