Question

Using QuickFixN, if I restart my trading application I occasionally am unable to logon, getting a "an existing connection was forcibly closed by the remote host" error. The QuickFix engine retries to connect every 30secs, but always gets the same error. If I close my application and re-open, it will connect correctly.

Speaking to my broker, it seems that they are rejecting my logins because they did not recognize my connection as being closed first time. 2nd time around, me forcing the application to close will tear-down the TCP connection, meaning that 3rd time logins work.

So my question is: is there a way to close and re-open the TCP connection without restarting the application?

Was it helpful?

Solution

Sounds like the problem is kinda on their end. Since the problem happens when you don't formally log out (e.g crash or abnormal termination), that means that their implementation apparently doesn't recognize the TCP termination.

At a higher-than-TCP layer, their FIX engine should somewhat compensate. If a few heartbeat durations occur after your disconnect, their implementation should realize you're not there anymore, since you're not responding to heartbeats.

So, neither their low-layer TCP handlers nor their FIX engine are able to set the right flag somewhere in their system that says you've gone offline. That's weird. I don't see what you can do about that, aside from intentionally doing a startup/shutdown to kludge their state flag for you.

I'm usually really hesitant to blame the other side (especially because I run the QF/n project), but that's where I'm at with the information provided.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top