TcpStream

Stream optimised for TCP connections. The given socket should be blocking.

Constructors

this
this(Socket socket, size_t bufferSize)
Undocumented in source.

Members

Functions

receive
ubyte[] receive()

Receive a single stream of data until the receive buffer is empty or an error occurs.

send
ptrdiff_t send(ubyte[] payload)

Sends a full payload (even when it biggen than the send buffer) and only returns when it is sent or on failure.

Inherited Members

From Stream

socket
Socket socket;

Socket used for writing and reading data.

last_recv
ptrdiff_t last_recv;
Undocumented in source.
send
ptrdiff_t send(ubyte[] buffer)

Sends bytes to the connected socket.

receive
ubyte[] receive()

Receives bytes from the connected socket.

lastRecv
ptrdiff_t lastRecv [@property getter]

Indicates the result of the last receive call performed on the connected socket.

Meta