SocketEngineSpec
@objc public protocol SocketEngineSpec
Specifies a SocketEngine.
-
The client for this engine.
Declaration
Swift
weak var client: SocketEngineClient? -
trueif this engine is closed.Declaration
Swift
var closed: Bool -
trueif this engine is connected. Connected means that the initial poll connect has succeeded.Declaration
Swift
var connected: Bool -
The connect parameters sent during a connect.
Declaration
Swift
var connectParams: [String: Any]? -
An array of HTTPCookies that are sent during the connection.
Declaration
Swift
var cookies: [HTTPCookie]? -
The queue that all engine actions take place on.
Declaration
Swift
var engineQueue: DispatchQueue -
A dictionary of extra http headers that will be set during connection.
Declaration
Swift
var extraHeaders: [String: String]? -
When
true, the engine is in the process of switching to WebSockets.Declaration
Swift
var fastUpgrade: Bool -
When
true, the engine will only use HTTP long-polling as a transport.Declaration
Swift
var forcePolling: Bool -
When
true, the engine will only use WebSockets as a transport.Declaration
Swift
var forceWebsockets: Bool -
If
true, the engine is currently in HTTP long-polling mode.Declaration
Swift
var polling: Bool -
If
true, the engine is currently seeing whether it can upgrade to WebSockets.Declaration
Swift
var probing: Bool -
The session id for this engine.
Declaration
Swift
var sid: String -
The path to engine.io.
Declaration
Swift
var socketPath: String -
The url for polling.
Declaration
Swift
var urlPolling: URL -
The url for WebSockets.
Declaration
Swift
var urlWebSocket: URL -
If
true, then the engine is currently in WebSockets mode.Declaration
Swift
var websocket: Bool -
The WebSocket for this engine.
Declaration
Swift
var ws: WebSocket? -
Creates a new engine.
Declaration
Swift
init(client: SocketEngineClient, url: URL, options: NSDictionary?) -
Starts the connection to the server.
Declaration
Swift
func connect() -
Called when an error happens during execution. Causes a disconnection.
Declaration
Swift
func didError(reason: String) -
Disconnects from the server.
Declaration
Swift
func disconnect(reason: String) -
Called to switch from HTTP long-polling to WebSockets. After calling this method the engine will be in WebSocket mode.
You shouldn’t call this directly
Declaration
Swift
func doFastUpgrade() -
Causes any packets that were waiting for POSTing to be sent through the WebSocket. This happens because when the engine is attempting to upgrade to WebSocket it does not do any POSTing.
You shouldn’t call this directly
Declaration
Swift
func flushWaitingForPostToWebSocket() -
Parses raw binary received from engine.io.
Declaration
Swift
func parseEngineData(_ data: Data) -
Parses a raw engine.io packet.
Declaration
Swift
func parseEngineMessage(_ message: String) -
Writes a message to engine.io, independent of transport.
Declaration
Swift
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data])
SocketEngineSpec Protocol Reference