Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kSocket_Read ( kSocket  socket,
void *  buffer,
kSize  size,
kSize read 
)

Reads one or more bytes.

In blocking mode, this function will block until at least one byte is received (or a read timeout occurs).

In non-blocking mode, this function will read at least one byte. kSocket_Wait should be used to determine when this function can be called successfully.

If the socket was closed by the remote peer, this function will return kERROR_CLOSED.

Parameters
socketSocket object.
bufferBuffer to receive bytes.
sizeThe maximum number of bytes to read.
readThe number of bytes that were read.
Returns
Operation status.