public void Stop() { if (_stopped) { return; } RequestStop(); MessageListenerWorker.CloseAll(); if (_server != null) { _server.Stop(); } }
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(); } } }