WebSocketKit Documentation Beta

Protocol Web​Socket​Connection​Delegate

public protocol WebSocketConnectionDelegate: AnyObject

Defines a delegate for a websocket connection.

%3 WebSocketConnectionDelegate WebSocketConnectionDelegate AnyObject AnyObject WebSocketConnectionDelegate->AnyObject

Conforms To

AnyObject

Requirements

web​Socket​Did​Connect(connection:​)

func webSocketDidConnect(connection: WebSocketConnection)

websocket​Did​Prepare(connection:​)

func websocketDidPrepare(connection: WebSocketConnection)

web​Socket​Did​Disconnect(connection:​close​Code:​reason:​)

func webSocketDidDisconnect(connection: WebSocketConnection, closeCode: NWProtocolWebSocket.CloseCode, reason: Data?)

websocket​Did​Cancel(connection:​)

func websocketDidCancel(connection: WebSocketConnection)

web​Socket​Did​Receive​Error(connection:​error:​)

func webSocketDidReceiveError(connection: WebSocketConnection, error: Error)

web​Socket​Did​Receive​Pong(connection:​)

func webSocketDidReceivePong(connection: WebSocketConnection)

web​Socket​Did​Receive​Message(connection:​string:​)

func webSocketDidReceiveMessage(connection: WebSocketConnection, string: String)

web​Socket​Did​Receive​Message(connection:​data:​)

func webSocketDidReceiveMessage(connection: WebSocketConnection, data: Data)