EveStreamTransport.read

ptrdiff_t read(ubyte[] buffer) @trusted nothrow

Reads 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

bufferDestination 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

SshIoResult code.