Search code examples
c++socketsconnectivityquickfixfix-protocol

Detecting loss of connection to fix gateway? (QuickFix)


I'm trying to find a good way to detect a loss of connection.

My adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway.

When I unplug the internet it takes about 30 seconds for the Fix::Application's onLogout method to be fired. It seems like some underlying class would be aware that there is a problem with the socket much earlier. Is there a quick way took hook into this?


Solution

  • The best way to solve this would probably be to decrease your Heartbeat Interval so you know sooner. I don't know of any messages that fire for a loss of TCP connection, but I don't think QuickFix is listening for OS events either. Although, it would likely flow through the fromAdmin event if there were such a message.

    Did you post your question to the QuickFix DL?