Пример #1
0
 /// <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();
 }
Пример #2
0
 /// <summary>
 /// Disposes the Client and releases resources
 /// </summary>
 protected virtual void OnDispose()
 {
     if (_socket != null)
     {
         _socket.Dispose();
         _socket = null;
         GC.SuppressFinalize(this);
     }
 }
Пример #3
0
 /// <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
 }
Пример #4
0
 /// <summary>
 /// Disposes the Client and releases resources
 /// </summary>
 public void Dispose()
 {
     lock (_lock)
     {
         if (_client != null)
         {
             _client.Dispose();
             _client = null;
             GC.SuppressFinalize(this);
         }
     }
 }
Пример #5
0
 /// <summary>
 /// Constructs a new SecureStringClient
 /// </summary>
 public Client()
 {
     _client = new Sockets.Socket();
     InitializeConnection();
 }
Пример #6
0
 /// <summary>
 /// Constructs a new StringClient
 /// </summary>
 public Client()
 {
     _socket = new W.Net.Sockets.Socket();
     ConfigureDelegates();
 }