/// <summary>
        /// Open Session to FXCM
        /// </summary>
        private void OpenSession()
        {
            try
            {
                // Create a new session object
                _session = O2GTransport.createSession();

                _session.useTableManager(O2GTableManagerMode.Yes, null);
                // Initialize listener
                _statusListener = new SessionStatusListener(_session, _logger);

                // Register event
                _statusListener.ConnectionEvent += OnSessionStatusChanged;

                // Register local listener
                _session.subscribeSessionStatus(_statusListener);

                _statusListener.Reset();

                // Send login request
                _session.login(_connectionParameters.LoginId, _connectionParameters.Password, _connectionParameters.Url,
                               _connectionParameters.Connection);
            }
            catch (Exception exception)
            {
                _logger.Error(exception, _type.FullName, "OpenSession");
            }
        }
        /// <summary>
        /// Called when FXCM session status changes
        /// </summary>
        /// <param name="status"></param>
        private void OnSessionStatusChanged(bool status)
        {
            _isConnected = status;

            if (_logger.IsInfoEnabled)
            {
                _logger.Info("Data Feed Server connected: " + _isConnected, _type.FullName, "OnSessionStatusChanged");
            }

            if (_isConnected)
            {
                // Initialize Table Manager for price updates
                _tableManager = _session.getTableManager();

                // Initialize Price listener
                _priceListener = new PriceListener(_tableManager, _logger);

                // Initialize Historical Data listener
                _historicalDataListener = new HistoricalDataListener(_session, _logger);
                _session.subscribeResponse(_historicalDataListener);

                _priceListener.DataEvent += OnDataArrived;
                _historicalDataListener.HistoricalDataEvent += OnHistoricalDataArrived;

                // Raise event to notify listeners
                if (LogonArrived != null)
                {
                    LogonArrived(_marketDataProviderName);
                }
            }
            else
            {
                // Unsubscribe Events
                _statusListener.ConnectionEvent             -= OnSessionStatusChanged;
                _priceListener.DataEvent                    -= OnDataArrived;
                _historicalDataListener.HistoricalDataEvent -= OnHistoricalDataArrived;

                _session.unsubscribeSessionStatus(_statusListener);
                _session.unsubscribeResponse(_historicalDataListener);

                _session.Dispose();
                _session        = null;
                _statusListener = null;
                _tableManager   = null;

                // Raise event to notify listeners
                if (LogoutArrived != null)
                {
                    LogoutArrived(_marketDataProviderName);
                }
            }
        }