public TcpConnection(HostConnectionPool pool, ReusableTcpClient client) { _pool = pool; _client = client; _stream = new BufferedStream(client.GetStream()); _controlTime = DateTime.Now; _buffer = new byte[TcpMessageIO.DefaultStreamBufferSize]; }
private TcpConnection CreateConnection() { try { ReusableTcpClient client = new ReusableTcpClient(_host, _port); TcpConnection entry = new TcpConnection(this, client); _activeConnections++; return(entry); } catch (Exception ex) { throw new RemotingException(ex.Message); } }