Beispiel #1
0
        protected virtual void Dispose(bool disposing)
        {
            lock (_disposeLock)
            {
                if (_isDisposed)
                {
                    return;
                }

                if (disposing)
                {
                    // free managed objects here
                    if (_socket != null)
                    {
                        _socket.Dispose();
                    }
                    if (_saeaPool != null)
                    {
                        _saeaPool.Dispose();
                    }
                }

                _isDisposed = true;
            }
        }
        protected virtual void Dispose(bool disposing)
        {
            lock (_disposeLock)
            {
                if (_isDisposed)
                {
                    return;
                }

                if (disposing)
                {
                    // free managed objects here
                    try
                    {
                        if (_listener != null)
                        {
                            _listener.Dispose();
                        }
                        if (_acceptSaeaPool != null)
                        {
                            _acceptSaeaPool.Dispose();
                        }
                        if (_handleSaeaPool != null)
                        {
                            _handleSaeaPool.Dispose();
                        }
                        if (_sessionPool != null)
                        {
                            _sessionPool.Dispose();
                        }
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex.Message, ex);
                    }
                }

                _isDisposed = true;
            }
        }