SocketParsable
public protocol SocketParsable : class
Defines that a type will be able to parse socket.io-protocol messages.
-
A list of packets that are waiting for binary data.
The way that socket.io works all data should be sent directly after each packet. So this should ideally be an array of one packet waiting for data.
This should not be modified directly.
Declaration
Swift
var waitingPackets: [SocketPacket]
-
parseBinaryData(_:)
Default implementationCalled when the engine has received some binary data that should be attached to a packet.
Packets binary data should be sent directly after the packet that expects it, so there’s confusion over where the data should go. Data should be received in the order it is sent, so that the correct data is put into the correct placeholder.
Default Implementation
Called when the engine has received some binary data that should be attached to a packet.
Packets binary data should be sent directly after the packet that expects it, so there’s confusion over where the data should go. Data should be received in the order it is sent, so that the correct data is put into the correct placeholder.
Declaration
Swift
func parseBinaryData(_ data: Data)
Parameters
data
The data that should be attached to a packet.
-
parseSocketMessage(_:)
Default implementationCalled when the engine has received a string that should be parsed into a socket.io packet.
Default Implementation
Called when the engine has received a string that should be parsed into a socket.io packet.
Declaration
Swift
func parseSocketMessage(_ message: String)
Parameters
message
The string that needs parsing.