Initializes a WebSocket message with a specific type code.


func nw_ws_create_metadata(_ opcode: nw_ws_opcode_t) -> nw_protocol_metadata_t

See Also

Handling WebSocket Messages

func nw_protocol_metadata_is_ws(nw_protocol_metadata_t) -> Bool

Checks whether a metadata object represents a WebSocket message.

struct nw_ws_opcode_t

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

struct nw_ws_close_code_t

Types of codes used upon closing a WebSocket connection.

func nw_ws_metadata_set_pong_handler(nw_protocol_metadata_t, DispatchQueue, nw_ws_pong_handler_t)

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

typealias 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.

func nw_ws_metadata_copy_server_response(nw_protocol_metadata_t) -> nw_ws_response_t

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