Exemplo n.º 1
0
 public override void Close()
 {
     if (Status == ServiceHostStatus.Stopped)
     {
         throw new InvalidOperationException("服务已经关闭。");
     }
     Status = ServiceHostStatus.Stopped;
     HostSocket.Close();
     HostSocket.Dispose();
     ConnectionCheckTimer.Enabled = false;
     while (ActiveClients.Count > 0)
     {
         var client = (SocketActiveClient)ActiveClients[0];
         client.Close();
     }
     ActiveClients.Clear();
     HostSocket = null;
 }
Exemplo n.º 2
0
 public void Reset()
 {
     ActiveClients.Clear();
 }