docs/Protocols/SocketEnginePollable.html
public protocol SocketEnginePollable : SocketEngineSpec
Protocol that is used to implement socket.io polling support
Properties
`
invalidated
`
true If engine’s session has been invalidated.
Swift
var invalidated: Bool { get }
`
postWait
`
A queue of engine.io messages waiting for POSTing
You should not touch this directly
Swift
var postWait: [Post] { get set }
`
session
`
The URLSession that will be used for polling.
Swift
var session: URLSession? { get }
`
waitingForPoll
`
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
Swift
var waitingForPoll: Bool { get set }
`
waitingForPost
`
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
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.
Call to send a long-polling request.
You shouldn’t need to call this directly, the engine should automatically maintain a long-poll request.
Swift
func doPoll()
`
sendPollMessage(_:withType:withData:completion:)
` Default implementation
Sends an engine.io message through the polling transport.
You shouldn’t call this directly, instead call the write method on SocketEngine.
Sends an engine.io message through the polling transport.
You shouldn’t call this directly, instead call the write method on SocketEngine.
Swift
func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: (() -> ())?)
| 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.
Call to stop polling and invalidate the URLSession.
Swift
func stopPolling()