Luciano
Luciano

Reputation: 2408

quickfix/j connection state machine

Could somebody explain Quickfix/J connectivity as a finite state machine (ideally w/ a diagram)?

Specifically what is the difference between the methods in SessionStateListener, (presumably representing the state changes), and what order should they occur in? :

What's the difference, for example between logon and connect? How is reset different from disconnect? how does onMissedHeartBeat differ from onHeartBeatTimeout? Is there a specific order these occur in e.g. can disconnect happen after a logon, but before a logoff? In this case would the state be reset to "logged out"?

Upvotes: 0

Views: 969

Answers (1)

DumbCoder
DumbCoder

Reputation: 5766

What's the difference, for example between logon and connect?

When you connect, a session is created between the initiator and acceptor. No messages can flow unless and until logon has happened. Logon is the authentication of the sender by the acceptor.

onMissedHeartBeat differ from onHeartBeatTimeout

There is HeartBtInt in the config file, which mentions how long the initiator would wait for a hearbeat. If it doesn't receive it signals the connection isn't stable. If I remember correctly(I might be wrong) Quickfix/J disconnects and you need to relogin. onMissedHeartBeat means you haven't received the heartbeat but maybe within, but also more than the timeout period.

Disconnect can happen anytime, even if you are logged in or about to logoff. The network got disrupted, your server crashed, there was an earthquake and power was disrupted. When disconnect happens the session is terminated and you have to start the whole process again.

Upvotes: 1

Related Questions