Docs
Launch GraphOS Studio
You're viewing documentation for a previous version of this software. Switch to the latest stable version.


PROTOCOL

WebSocketClientDelegate

public protocol WebSocketClientDelegate: AnyObject

The delegate for a WebSocketClient to recieve notification of socket events.

Methods

websocketDidConnect(socket:)

func websocketDidConnect(socket: WebSocketClient)

The websocket client has started a connection to the server.

  • Parameter socket: The WebSocketClient that sent the delegate event.

Parameters

NameDescription
socketThe WebSocketClient that sent the delegate event.

websocketDidDisconnect(socket:error:)

func websocketDidDisconnect(socket: WebSocketClient, error: Error?)

The websocket client has disconnected from the server.

  • Parameters:
    • socket: The WebSocketClient that sent the delegate event.
    • error: An optional error if an error occured.

Parameters

NameDescription
socketThe WebSocketClient that sent the delegate event.
errorAn optional error if an error occured.

websocketDidReceiveMessage(socket:text:)

func websocketDidReceiveMessage(socket: WebSocketClient, text: String)

The websocket client received message text from the server

  • Parameters:
    • socket: The WebSocketClient that sent the delegate event.
    • text: The text received from the server.

Parameters

NameDescription
socketThe WebSocketClient that sent the delegate event.
textThe text received from the server.

websocketDidReceiveData(socket:data:)

func websocketDidReceiveData(socket: WebSocketClient, data: Data)

The websocket client received data from the server

  • Parameters:
    • socket: The WebSocketClient that sent the delegate event.
    • data: The data received from the server.

Parameters

NameDescription
socketThe WebSocketClient that sent the delegate event.
dataThe data received from the server.
Next
Introduction
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company