示例#1
0
 public TcpConnection(HostConnectionPool pool, ReusableTcpClient client)
 {
     _pool        = pool;
     _client      = client;
     _stream      = new BufferedStream(client.GetStream());
     _controlTime = DateTime.Now;
     _buffer      = new byte[TcpMessageIO.DefaultStreamBufferSize];
 }
示例#2
0
 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);
     }
 }