public void Add(byte[] obj) { if (Reconstructor == null) { throw new Exception("got binary data when not reconstructing a packet"); } var packet = Reconstructor.TakeBinaryData(obj); if (packet != null) { Reconstructor = null; Emit(EVENT_DECODED, packet); } }
public void Add(byte[] obj) { if (this.Reconstructor == null) { throw new SocketIOException("got binary data when not reconstructing a packet"); } else { var packet = this.Reconstructor.TakeBinaryData(obj); if (packet != null) { this.Reconstructor = null; this.Emit(EVENT_DECODED, packet); } } }
public void Add(string obj) { Packet packet = decodeString(obj); if (packet.Type == BINARY_EVENT || packet.Type == BINARY_ACK) { this.Reconstructor = new BinaryReconstructor(packet); if (this.Reconstructor.reconPack.Attachments == 0) { this.Emit(EVENT_DECODED, packet); } } else { this.Emit(EVENT_DECODED, packet); } }