Пример #1
0
 public virtual void Stop()
 {
     isUp = false;
     if (this.listener != null)
     {
         this.listener.Stop();
     }
     mainLoop.Abort();
     mainLoop = null;
     if (clientSocket != null)
     {
         clientSocket.Close();
     }
 }
Пример #2
0
        public virtual void Stop()
        {
            isUp     = false;
            shutdown = true;
            if (this.listener != null)
            {
                this.listener.Stop();
            }
            mainLoop = null;
            if (clientSocket != null)
            {
                clientSocket.Close();
            }

            if (udpSocket != null)
            {
                var _socket = udpSocket;
                udpSocket = null;
                _socket.Close();
            }
        }