Exemplo n.º 1
0
 /// <summary>
 /// 断开,移除所有终端链接
 /// </summary>
 /// 时间:2016-04-12 19:19
 /// 备注:
 public void ClearAllClients()
 {
     if (ClientList != null)
     {
         for (int i = 0; i < ClientList.Count; i++)
         {
             SocketObj _socketClient = ClientList[i];
             ClientList.Remove(_socketClient);
             _socketClient.Close();
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 关闭会话
 /// </summary>
 public void Close()
 {
     try
     {
         if (SocketObj != null)
         {
             SocketObj.Close();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }