SocketEngineClient

@objc
public protocol SocketEngineClient

Declares that a type will be a delegate to an engine.

Methods

  • Called when the engine errors.

    Declaration

    Swift

    func engineDidError(reason: String)

    Parameters

    reason

    The reason the engine errored.

  • Called when the engine closes.

    Declaration

    Swift

    func engineDidClose(reason: String)

    Parameters

    reason

    The reason that the engine closed.

  • Called when the engine opens.

    Declaration

    Swift

    func engineDidOpen(reason: String)

    Parameters

    reason

    The reason the engine opened.

  • Called when the engine receives a ping message. Only called in socket.io >3.

    Declaration

    Swift

    func engineDidReceivePing()
  • Called when the engine receives a pong message. Only called in socket.io 2.

    Declaration

    Swift

    func engineDidReceivePong()
  • Called when the engine sends a ping to the server. Only called in socket.io 2.

    Declaration

    Swift

    func engineDidSendPing()
  • Called when the engine sends a pong to the server. Only called in socket.io >3.

    Declaration

    Swift

    func engineDidSendPong()
  • Called when the engine has a message that must be parsed.

    Declaration

    Swift

    func parseEngineMessage(_ msg: String)

    Parameters

    msg

    The message that needs parsing.

  • Called when the engine receives binary data.

    Declaration

    Swift

    func parseEngineBinaryData(_ data: Data)

    Parameters

    data

    The data the engine received.

  • Called when when upgrading the http connection to a websocket connection.

    Declaration

    Swift

    func engineDidWebsocketUpgrade(headers: [String : String])

    Parameters

    headers

    The http headers.