public LightJsonTCPAdapter(TcpClient connectedClient) { if (!connectedClient.Connected) { throw new Exception(); } if (!connectedClient.Client.Blocking) { throw new Exception(); } TCPcl = connectedClient; netwStreamAdapter = new BlockingPeekReader(TCPcl.GetStream()); streamWriter = new StreamWriter(TCPcl.GetStream()); LJ_Reader = new LightJson.Serialization.JsonReader(netwStreamAdapter); LJ_Writer = new LightJson.Serialization.JsonWriter(streamWriter); }
public CMD_Base ReadInternal(LightJson.Serialization.JsonReader LJ_Reader) // with explicit stream adapter for convenient unit tesing { return(LightJsonExtensions.CMD_from_JSonValue(LJ_Reader.ReadJsonValue())); }