Zen API

- Home
- Topics
- Types
- Files

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

  socket | Socket object.
  buffer | Buffer to receive bytes.
  size | The maximum number of bytes to read.
  read | The number of bytes that were read.

Returns
  Operation status.