write


Description:

public SocketIOStatus write (uint8[] buffer, out size_t nwrote, Cancellable? cancellable = null) throws Error

Attempts to write buffer.length bytes from buffer to this.

If some data is successfully written, the return status will be OK, and *nwrote will contain the number of bytes actually written (which may be less than buffer.length).

If this is non-blocking, and no data could be written right away, the return value will be WOULD_BLOCK. In this case, the caller can connect to the writable signal to know when more data can be written. (NB: writable is only emitted after write returns WOULD_BLOCK, and it is only emitted once. See the documentation for non_blocking.)

Parameters:

this

the socket

buffer

data to write

nwrote

on return, number of bytes written

cancellable

a Cancellable, or null

len

size of buffer, in bytes

Returns:

a SocketIOStatus, as described above (or EOF or ERROR. error will be set if the return value is ERROR.)