SshIoResult code.
EveStreamTransport.read
ptrdiff_t read(ubyte[] buffer) @trusted nothrowReads buffered data into the provided buffer.
Buffered bytes are always served first, even after a close event. When the buffer is empty the result reports the close state: clean EOF as zero, a failed connection as SshIoResult.ERROR, a locally closed transport as SshIoResult.CLOSED, and otherwise SshIoResult.WOULD_BLOCK.
Parameters
buffer | Destination buffer; a zero-length buffer never reports a fake EOF and yields SshIoResult.WOULD_BLOCK. |
Returns
Bytes read (positive), 0 on clean EOF, or a negative