Skip to content

MTY_WebSocketRead

chrisd1100 edited this page Aug 25, 2022 · 1 revision

Read a message from a WebSocket.

MTY_Async MTY_WebSocketRead(
    MTY_WebSocket * ctx,
    uint32_t        timeout,
    char *          msg,
    size_t          size
);

Parameters

ctx (MTY_WebSocket *)

An MTY_WebSocket.

timeout (uint32_t)

Time to wait in milliseconds for a message to become available.

msg (char *)

Output message buffer.

size (size_t)

Size in bytes of msg.

Return value

MTY_Async

MTY_ASYNC_OK means a message has been successfully read into msg.

MTY_ASYNC_CONTINUE means the timeout has been reached without a message.

MTY_ASYNC_ERROR means an error has occurred. Call MTY_GetLog for details.

Platform support

Windows   macOS   Android   Linux   Web  

See also

Module: Net

Clone this wiki locally