public TcpConnection(HostConnectionPool pool, ReusableTcpClient client) { _pool = pool; _client = client; _stream = new BufferedStream(client.GetStream()); _controlTime = DateTime.Now; _buffer = new byte[TcpMessageIO.DefaultStreamBufferSize]; }
public static TcpConnection GetConnection(string host, int port) { HostConnectionPool hostPool; lock (_pools) { string key = host + ":" + port; hostPool = (HostConnectionPool)_pools[key]; if (hostPool == null) { hostPool = new HostConnectionPool(host, port); _pools[key] = hostPool; } } return(hostPool.GetConnection()); }
public static TcpConnection GetConnection (string host, int port) { HostConnectionPool hostPool; lock (_pools) { string key = host + ":" + port; hostPool = (HostConnectionPool) _pools[key]; if (hostPool == null) { hostPool = new HostConnectionPool(host, port); _pools[key] = hostPool; } } return hostPool.GetConnection(); }
public TcpConnection (HostConnectionPool pool, ReusableTcpClient client) { _pool = pool; _client = client; _stream = new BufferedStream (client.GetStream()); _controlTime = DateTime.Now; _buffer = new byte[TcpMessageIO.DefaultStreamBufferSize]; }