/// <summary> /// Constructs a new SecureStringClient /// </summary> /// <param name="client">An existing connected TcpClient</param> public Client(TcpClient client) { IsServerSide = true; _client = new Sockets.Socket(client); IsConnectedResetEvent.Set(); InitializeConnection(); }
/// <summary> /// Disposes the Client and releases resources /// </summary> protected virtual void OnDispose() { if (_socket != null) { _socket.Dispose(); _socket = null; GC.SuppressFinalize(this); } }
/// <summary> /// Constructs a new StringClient /// </summary> /// <param name="client">An existing connected TcpClient</param> public Client(TcpClient client) { IsServerSide = true; _socket = new W.Net.Sockets.Socket(client); ConfigureDelegates(); //8.15.2017 - moved this up a line //because this might be a SecureClient, we must call OnConnected instead of handling it here OnConnected(client.Client.RemoteEndPoint.As <IPEndPoint>()); //IsConnectedResetEvent.Set(); //have to set this because we're already connected }
/// <summary> /// Disposes the Client and releases resources /// </summary> public void Dispose() { lock (_lock) { if (_client != null) { _client.Dispose(); _client = null; GC.SuppressFinalize(this); } } }
/// <summary> /// Constructs a new SecureStringClient /// </summary> public Client() { _client = new Sockets.Socket(); InitializeConnection(); }
/// <summary> /// Constructs a new StringClient /// </summary> public Client() { _socket = new W.Net.Sockets.Socket(); ConfigureDelegates(); }