Enumeration

nw_ws_opcode_t

Types of messages that you send and receive on a WebSocket connection.

Declaration

typedef enum : int {
    ...
} nw_ws_opcode_t;

Topics

Data Types

nw_ws_opcode_binary

A binary data message.

nw_ws_opcode_text

A text data message.

nw_ws_opcode_cont

A continuation message.

Control Types

nw_ws_opcode_ping

A Ping message, which requests a Pong from the peer.

nw_ws_opcode_pong

A Pong message in response to a Ping from the peer.

nw_ws_opcode_close

A message indicating a close of the connection.

nw_ws_opcode_invalid

The message is not valid.

See Also

Handling WebSocket Messages

nw_protocol_metadata_is_ws

Checks whether a metadata object represents a WebSocket message.

nw_ws_create_metadata

Initializes a WebSocket message with a specific type code.

nw_ws_metadata_get_opcode

Checks the type code on a WebSocket message.

nw_ws_metadata_set_close_code

Sets a close code on a WebSocket message.

nw_ws_metadata_get_close_code

Accesses the close code on a WebSocket message.

nw_ws_close_code_t

Types of codes used upon closing a WebSocket connection.

nw_ws_metadata_set_pong_handler

Sets a handler on a Ping message to be invoked when the corresponding Pong message is received.

nw_ws_pong_handler_t

A handler that indicates that a Pong message has been received for a previously sent Ping message, or that an error was encountered.

nw_ws_metadata_copy_server_response

Accesses the WebSocket server's response sent during the handshake.