Esempio n. 1
0
 /// <summary>
 /// Stops listening for and disconnects all current connections
 /// </summary>
 public void Stop()
 {
     while (_clients.Count > 0)
         _clients[0].Socket.Disconnect();
     _listenProc?.Cancel();
     _listenProc?.Join(1000);
     _listenProc = null;
     _server?.Stop();
     IsListening = false;
 }
Esempio n. 2
0
 /// <summary>
 /// Stops listening for and disconnects all current connections
 /// </summary>
 public void Stop()
 {
     while (_clients.Count > 0)
     {
         _clients[0].DisconnectAsync().Wait();
     }
     _listenProc?.Cancel();
     _listenProc?.Join(1000);
     _listenProc = null;
     _server?.Stop();
     IsListening = false;
 }