示例#1
0
        /// <summary>
        /// The HandleConnect_Entrypoint method is the asynchronous
        /// entrypoint for the session's connect handling logic.
        /// </summary>
        /// <param name="state">
        /// Ignored parameter; required for the method to meet the
        /// required signature for use with the sequencer.
        /// </param>
        private void HandleConnect_Entrypoint(object state)
        {
            // REC: Transition the session to the active state so
            // that it can begin handling messages:
            _currentState = SessionStates.Session_Pending;

            // REC: Reset the receive timestamp:
            this._lastRxTicks = DateTime.Now.Ticks;

            // REC: Reset the transmit timestamp:
            this._lastTxTicks = DateTime.Now.Ticks;


            // REC: Acquire the session's persisted session
            // state from the database:
            if (_fixDatabase != null)
            {
                _sessionRecord = _fixDatabase.AcquireSession(_sessionId);
            }

            // REC: The session's timer is started in order
            // to drive the heartbeat and timeout logic:
            this._fixTimer.Start();

            _handler.OnSessionOpened(this);

            // REC: The client session needs to dispatch a logon
            // message to the peer as soon as it connects:
            FixMessage msgLogon = _fixAssembler.CreateMessage(_sxVersion, _axVersion, "A");

            if (msgLogon != null)
            {
                Dispatch_AdmMessage(msgLogon);
            }
        }
示例#2
0
        /// <summary>
        /// The HandleConnect_Entrypoint method is the asynchronous
        /// entrypoint for the session's connection handling code.
        /// </summary>
        /// <param name="state">
        /// Ignored parameter; required for the method to match the
        /// signature needed for use with the task sequencer.
        /// </param>
        private void HandleConnect_Entrypoint(object state)
        {
            // REC: Transition the session to the active state so
            // that it can begin handling messages:
            _currentState = SessionStates.Session_Pending;

            // REC: Reset the receive timestamp:
            this._lastRxTicks = DateTime.Now.Ticks;

            // REC: Reset the transmit timestamp:
            this._lastTxTicks = DateTime.Now.Ticks;

            // REC: Note that the persisted session information
            // cannot be retrieved here, as it is in the client
            // session implementations. The server will resolve
            // that information once the client logs on...

            // REC: The session's timer is started in order
            // to drive the heartbeat and timeout logic:
            this._fixTimer.Start();

            // REC: Notify the handler:
            _handler.OnSessionOpened(this);
        }