Wapiti
Wapiti

Reputation: 1911

Distinguishing between two QuickFix initiator sessions

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

Answers (1)

hunch_hunch
hunch_hunch

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

Related Questions