public static Setup ( IDebugger debugger ) : void | ||
debugger | IDebugger | |
return | void |
/// <summary> /// Read the command response /// </summary> /// <returns></returns> public byte[] Read() { byte[] buffer = new byte[1024]; StringBuilder msg = new StringBuilder(); int bytesRead = 0; // Incoming message may be larger than the buffer size. do { bytesRead = stream.Read(buffer, 0, buffer.Length); msg.AppendFormat("{0}", Encoding.UTF8.GetString(buffer, 0, bytesRead)); }while (stream.DataAvailable); byte[] bytes = Encoding.UTF8.GetBytes(msg.ToString()); if (loggingEnabled) { Debug.Setup(new ConsoleLogger()); Debug.Log("****************** Received ******************"); Debug.Log(bytes); } return(bytes); }
/// <summary> /// Writes an XmlDocument to the transport stream /// </summary> /// <param name="s"></param> public void Write(XmlDocument s) { byte[] buffer = GetBytes(s); stream.Write(buffer, 0, buffer.Length); if (loggingEnabled) { Debug.Setup(new ConsoleLogger()); Debug.Log("****************** Sending ******************"); Debug.Log(buffer); } }