public ClientConnection(ProtoClient client, TcpClient tcpClient, string hostname, IStreamManager streamManager) : base(tcpClient, streamManager, client.ServiceAssembly) { Require.NotNull(client, "client"); Require.NotNull(hostname, "hostname"); _client = client; _hostname = hostname; Connect(); }
protected override void Dispose(bool disposing) { if (!_disposed) { var client = _client; _client = null; if (client != null) client.Dispose(); _disposed = true; } base.Dispose(disposing); }