Attempts to read up to buffer.length
bytes from this into buffer
.
If some data is successfully read, read will return
OK, and *nread
will contain the number of bytes actually read (which may be less than buffer.length
).
If this is non-blocking, and no data is available, the return value will be WOULD_BLOCK. In this case, the caller can connect to the readable signal to know when there is more data to read. (NB: You MUST read all available data off the socket first. readable is only emitted after read returns WOULD_BLOCK, and it is only emitted once. See the documentation for non_blocking.)
this |
the socket |
buffer |
buffer to read into |
nread |
on return, the number of bytes read into |
cancellable |
a Cancellable, or |
len |
size of |
a SocketIOStatus, as described above (or
EOF if the socket is no longer connected, or
ERROR on any other error, in which case |