We have a requirement to be able to stop and start individual Sessions
without having to bring down our entire QuickFIX engine. It is not
immediately obvious how to do this from browsing the code. As near as
I can figure calling Session::logout () and Session::disconnect ()
should have the desired effect; the Initiator will not try
reconnecting, since logout sets m_enabled = false. Is this correct?
for ( ; i != disconnected.end(); ++i )
{
Session* pSession = Session::lookupSession( *i );
if ( pSession->isEnabled() && pSession->isSessionTime() )
setConnected( *i, doConnect( *i, m_settings.get( *i ) ) );
}
Also, any thoughts on modifying the Initiator class to allow sessions
to be *reconfigured* while the engine is running? Essentially, I'd
like to be able to pass a new SessionSettings to the Intiiator at
runtime and then any Sessions which are started/restarted after this
point will use these updated settings. This would primarily be for
changing things like the host and port on the connection intra-day if
required (e.g. some sort of failover scenario).
To implement this I think I'd just add a new Initiator::reconfigure
method which would re-initialize the m_settings member and then call
onConfigure.
--
Caleb Epstein
caleb dot epstein at gmail dot com
|