SocketEnginePollable

public protocol SocketEnginePollable : SocketEngineSpec

Protocol that is used to implement socket.io polling support

Properties

  • true If engine’s session has been invalidated.

    Declaration

    Swift

    var invalidated: Bool { get }
  • A queue of engine.io messages waiting for POSTing

    You should not touch this directly

    Declaration

    Swift

    var postWait: [Post] { get set }
  • The URLSession that will be used for polling.

    Declaration

    Swift

    var session: URLSession? { get }
  • true if there is an outstanding poll. Trying to poll before the first is done will cause socket.io to disconnect us.

    Do not touch this directly

    Declaration

    Swift

    var waitingForPoll: Bool { get set }
  • true if there is an outstanding post. Trying to post before the first is done will cause socket.io to disconnect us.

    Do not touch this directly

    Declaration

    Swift

    var waitingForPost: Bool { get set }

Methods

  • doPoll() Default implementation

    Call to send a long-polling request.

    You shouldn’t need to call this directly, the engine should automatically maintain a long-poll request.

    Default Implementation

    Call to send a long-polling request.

    You shouldn’t need to call this directly, the engine should automatically maintain a long-poll request.

    Declaration

    Swift

    func doPoll()
  • Sends an engine.io message through the polling transport.

    You shouldn’t call this directly, instead call the write method on SocketEngine.

    Default Implementation

    Sends an engine.io message through the polling transport.

    You shouldn’t call this directly, instead call the write method on SocketEngine.

    Declaration

    Swift

    func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: (() -> ())?)

    Parameters

    message

    The message to send.

    withType

    The type of message to send.

    withData

    The data associated with this message.

  • stopPolling() Default implementation

    Call to stop polling and invalidate the URLSession.

    Default Implementation

    Call to stop polling and invalidate the URLSession.

    Declaration

    Swift

    func stopPolling()