Reputation: 1911
I am using QuickFix with Python bindings to connect to a broker and I have two Initiator Sessions in my config file. One is for the price and the other for the order session.
My question is, say I want to do something when only one of them comes online? If I do
initiator = fix.SocketInitiator(application, storeFactory, settings, logFactory)
if initiator.isLoggedOn():
function()
then function
will be called whether it is the price or order session or both that are logged on. How do I identify when a specific initiator session is logged on?
Upvotes: 2
Views: 1507
Reputation: 2331
As you noted, the method bool Initiator::isLoggedOn()
will tell you if any session is currently logged on.
Use bool Initiator::isConnected( const SessionID& sessionID )
to check a specific session.
SocketInitiator
inherits both of these from Initiator
.
Upvotes: 1