SocketEngineWebsocket
public protocol SocketEngineWebsocket : SocketEngineSpec
Protocol that is used to implement socket.io WebSocket support
-
Whether or not the ws is connected
Declaration
Swift
var wsConnected: Bool { get }
-
sendWebSocketMessage(_:
Default implementationwithType: withData: completion: ) Sends an engine.io message through the WebSocket transport.
You shouldn’t call this directly, instead call the
write
method onSocketEngine
.Default Implementation
Sends an engine.io message through the WebSocket transport.
You shouldn’t call this directly, instead call the
write
method onSocketEngine
.Declaration
Swift
func sendWebSocketMessage(_ str: 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.
completion
Callback called on transport write completion.