private void Send(EngineIOPacket packet) { Logger.Log(string.Format("send packet type = '{0}', rawData = {1}", packet.Type, packet.Serialize())); var str = packet.Serialize(); _websocket.Send(str); }
public static EngineIOSession GetSession(this EngineIOPacket packet) { if (packet.Type != EngineIOPacketType.open) { throw new System.Exception("session only exists in 'open' message type"); } return(JsonConvert.DeserializeObject <EngineIOSession>(packet.Data)); }