Ejemplo n.º 1
0
 /// <summary>
 /// 停止更新
 /// </summary>
 public void UpdateEnd()
 {
     if (IsServerMode)
     {
         lock (remoteSockets)
         {
             for (int i = 0, len = remoteSockets.Length; i < len; i++)
             {
                 var remote = remoteSockets[i];
                 if (remote != null && remote.IsAlive)
                 {
                     remote.CloseSocket();
                 }
             }
         }
         if (TcpServer != null)
         {
             TcpServer.CloseSocket();
         }
         if (UdpServer != null)
         {
             UdpServer.CloseSocket();
         }
     }
     else
     {
         if (tcpClient != null)
         {
             tcpClient.CloseSocket();
         }
         if (udpClient != null)
         {
             udpClient.CloseSocket();
         }
     }
 }