Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages

kStatus kWebSocket_ReadMessage | ( | kWebSocket | webSocket,
|  | kMemory | memory,
|  | k64u | timeout
| ) |  |

Blocks until a whole message has been read (or until a timeout occurs).

This method can be used as an alternative to kWebSocket_Receive/kStream_Read.

The 'memory' argument provides an interface to accept the received message data. This enables the caller to accept a message without knowing the message size beforehand. A kMemory object can be used to accept data into an arbitrary memory location.

The timeout parameter determines the length of time to wait for the first message header to arrive.

Parameters

  webSocket | WebSocket object.
  memory | Memory stream object that will receive message data.
  timeout | Timeout, in microseconds.

Returns
  Operation status.