Exemplo n.º 1
0
 public void Stop()
 {
     if (_stopped)
     {
         return;
     }
     RequestStop();
     MessageListenerWorker.CloseAll();
     if (_server != null)
     {
         _server.Stop();
     }
 }
Exemplo n.º 2
0
        private void DoAcceptTcpClientCallback(Object clientObject)
        {
            if (_stopped)
            {
                return;
            }
            MessageListenerWorker mlw = null;

            try
            {
                TcpClient client = (TcpClient)clientObject;
                mlw = new MessageListenerWorker(client, this);
                mlw.AcceptMessage();
            }
            catch (Exception e)
            {
                Logger.GetInstance().Write(e);
                if (mlw != null)
                {
                    mlw.Close();
                }
            }
        }