[Quickfix-developers] SendToTarget...
Brought to you by:
orenmnero
From: John H. <jr...@ya...> - 2009-06-09 15:26:50
|
I am interested in designing behavior in my application such that I intelligently handle a scenario whereby SendToTarget might return False. The scenario I am interested in handling is one where the FIX connection has been lost and I attempt to send a new order to the exchange. My problem (as I understand it) is that if I call SendToTarget while the connection is down, QuickFix will store the message for later transmission when the session gets reestablished. If you can imagine a scenario where a user tries to send an order which fails (perhaps because the network connection to the workstation is down), I have a potential issue with the order subsequently being transmitted at a later time when the connection is reestablished. If the market has moved since, the order may now be so far away (or through) the market that sending it would be a big issue. Does anybody have any insight as to what circumstances might cause SendToTarget to fail? Similarly does anybody have any suggestions on how I might construct my application such that if a SendToTarget fails, the attempted NewOrderSingle is discarded and NOT sent on a subsequent reconnection? (fyi I'm using the generic QF build out of the box in a .NET environment.) I have constructed my code such that I do check that the session is logged on immediately prior to attempting to send the order, but this leaves the possibility that the session drops immediately after I check isLoggedOn but before I attempt to SendToTarget. Any advice would be greatly appreciated. Many thanks, John |