Exemple #1
0
        public override void Stop()
        {
            if (_SocketConnector != null)
            {
                _SocketConnector.Stop();
                _SocketConnector.Dispose();
            }

            if (_Listeners != null && _Listeners.Count > 0)
            {
                foreach (ISocketListener socketListener in _Listeners)
                {
                    socketListener.Stop();
                    socketListener.NewClientAccepted -= tcpSocketListener_NewClientAccepted;
                    socketListener.Error             -= tcpSocketListener_Error;
                    socketListener.Stopped           -= tcpSocketListener_Stopped;
                }
                _Listeners.Clear();
                _Listeners = null;
            }

            if (_SocketAsyncPool != null)
            {
                _SocketAsyncPool.Clear();
                _SocketAsyncPool = null;
            }

            _BufferManager = null;


            base.Stop();
        }
Exemple #2
0
 private void CloseBrokerConnection()
 {
     if (_ioHandler != null)
     {
         _ioHandler.Dispose();
         _ioHandler = null;
     }
     if (_connector != null)
     {
         _connector.Dispose();
         _connector = null;
     }
 }