コード例 #1
0
ファイル: Client.cs プロジェクト: CharcoStudios/Tungsten
 /// <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
ファイル: Client.cs プロジェクト: CharcoStudios/Tungsten
 /// <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
ファイル: Client.cs プロジェクト: CharcoStudios/Tungsten
 /// <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();
 }