SocketEngineWebsocket
public protocol SocketEngineWebsocket : SocketEngineSpec, WebSocketDelegate
Protocol that is used to implement socket.io WebSocket support
-
sendWebSocketMessage(_:withType:withData:)
Default implementationSends 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])
Parameters
message
The message to send.
withType
The type of message to send.
withData
The data associated with this message.
-
websocketDidReceiveMessage(socket:text:)
Extension methodDelegate method for when a message is received.
Declaration
Swift
public func websocketDidReceiveMessage(socket: WebSocket, text: String)
-
websocketDidReceiveData(socket:data:)
Extension methodDelegate method for when binary is received.
Declaration
Swift
public func websocketDidReceiveData(socket: WebSocket, data: Data)