Esempio n. 1
0
 /// <summary>
 /// 关闭该连接对象,释放相关资源,非完全释放Socket对象
 /// </summary>
 public void Close()
 {
     if (TokenSocket != null)
     {
         try
         {
             TokenSocket.Shutdown(SocketShutdown.Send);
         }
         catch (ObjectDisposedException)
         { return; }
         catch { }
         TokenSocket.Close();
     }
 }
 /// <summary>
 /// 关闭该连接对象,释放相关资源,非完全释放Socket对象
 /// </summary>
 public void Close()
 {
     if (TokenSocket != null)
     {
         if (TokenSocket.Connected)
         {
             try
             {
                 TokenSocket.Shutdown(SocketShutdown.Send);
             }
             catch
             { }
         }
         TokenSocket.Close();
     }
 }