Class EngineIOPacket
- Namespace
- Firesplash.GameDevAssets.SocketIOPlus.EngineIO
- Assembly
- Firesplash.GameDevAssets.SocketIOPlus.dll
Class used to create a packet to be sent via WebSocket to a server using the Engine.IO protocol
public class EngineIOPacket
- Inheritance
-
EngineIOPacket
Constructors
EngineIOPacket(byte[])
Creates a packet for a binary-typed MESSAGE This can not be used to parse an incoming message!
public EngineIOPacket(byte[] messagePayload)
Parameters
messagePayload
byte[]
EngineIOPacket(string)
Creates a packet for a string-typed MESSAGE This can not be used to parse an incoming message!
public EngineIOPacket(string messagePayload)
Parameters
messagePayload
string
Methods
GetPacketType()
public DataTypes.EIOPacketType GetPacketType()
Returns
GetPayloadBytes()
public byte[] GetPayloadBytes()
Returns
- byte[]
GetPayloadString()
public string GetPayloadString()
Returns
IsBinaryMessage()
public bool IsBinaryMessage()
Returns
Parse(bool, byte[])
Used to parse a received byte array from the transport into an Engine.IO packet
public static EngineIOPacket Parse(bool isBinaryMessage, byte[] webSocketMessageBytes)
Parameters
isBinaryMessage
boolSet this true, if the message was received as binary message. Otherwise false.
webSocketMessageBytes
byte[]The received byte array
Returns
- EngineIOPacket
The parsed package instance