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