One Logo Pool Ball
Network · IOS API REFERENCE

NWProtocolWebSocket.Metadata

class · iOS 13.0+ · SDK 27.1

class Metadata

A WebSocket metadata can be attached to an `NWConnection.send()` call to provide context for the WebSocket frame.

Members (7)

method · iOS 13.0+

setPongHandler

TypeScript
setPongHandler(queue: _Dispatch_DispatchQueue, handler: ((arg0: (NWError) | null) => void)): void
Swift declaration
@preconcurrency func setPongHandler(_ queue: DispatchQueue, handler: @escaping @Sendable (NWError?) -> Void)

Set a callback handler to notify the user when the pong message for the ping message sent with this context's metadata has been received. - Parameter queue: Set the queue on which the callback handler will be delivered. - Parameter handler: The callback handler that will be invoked when the pong message has been received. The handler may optionally return an error if the connection fails or is cancelled before the pong is replied.

get · iOS 13.0+

selectedSubprotocol

TypeScript
get selectedSubprotocol(): (string) | null
Swift declaration
var selectedSubprotocol: String? { get }

The server's selected subprotocol.

get · iOS 13.0+

additionalServerHeaders

TypeScript
get additionalServerHeaders(): (Array<[string, string]>) | null
Swift declaration
var additionalServerHeaders: [(String, String)]? { get }

Any additional headers included in the server's response.

get · iOS 13.0+

opcode

TypeScript
get opcode(): NWProtocolWebSocket_Opcode
Swift declaration
final let opcode: NWProtocolWebSocket.Opcode

The opcode on a WebSocket frame.

init · iOS 13.0+

init

TypeScript
static init(opcode: NWProtocolWebSocket_Opcode): NWProtocolWebSocket_Metadata
Swift declaration
init(opcode: NWProtocolWebSocket.Opcode)

Create a protocol metadata object that can be used to define the context of messages sent over a WebSocket connection. - Parameter opcode: Set the opcode on a WebSocket frame.

get · iOS 13.0+

closeCode

TypeScript
get closeCode(): NWProtocolWebSocket_CloseCode
Swift declaration
var closeCode: NWProtocolWebSocket.CloseCode { get set }

The close code on a WebSocket frame.

set · iOS 13.0+

closeCode

TypeScript
set closeCode(value: NWProtocolWebSocket_CloseCode)
Swift declaration
var closeCode: NWProtocolWebSocket.CloseCode { get set }

The close code on a WebSocket frame.

Skipped declarations

No declarations were skipped in this snapshot.

All Network types →