protected BaseConnection(PortListener portBinding, TcpClient tcpClient) { if (portBinding == null) throw new ArgumentNullException("portBinding"); if (tcpClient == null) throw new ArgumentNullException("tcpClient"); PortBinding = portBinding; TcpClient = tcpClient; ConnectionInitiated = DateTime.UtcNow; NetworkStream = tcpClient.GetStream(); Reader = new StringReaderStream(NetworkStream); Writer = new StreamWriter(NetworkStream) { AutoFlush = true }; RemoteEndPoint = (IPEndPoint)tcpClient.Client.RemoteEndPoint; }
protected BaseConnection(PortListener portBinding, TcpClient tcpClient) { if (portBinding == null) { throw new ArgumentNullException("portBinding"); } if (tcpClient == null) { throw new ArgumentNullException("tcpClient"); } PortBinding = portBinding; TcpClient = tcpClient; ConnectionInitiated = DateTime.UtcNow; NetworkStream = tcpClient.GetStream(); Reader = new StringReaderStream(NetworkStream); Writer = new StreamWriter(NetworkStream) { AutoFlush = true }; RemoteEndPoint = (IPEndPoint)tcpClient.Client.RemoteEndPoint; }