[Quickfix-developers] QuickFIX/J mystery....
Brought to you by:
orenmnero
|
From: Tom D. <to...@di...> - 2005-12-16 21:31:28
|
Hi, folks... Any insight into this strangeness would be very welcome... I have a QuickFIX/J application that is working, but only when I put some baling wire and chewing gum (a hack) into it. This application has a single initiator session, and I've used ThreadedSocketInitiator. Without the hack, on startup the following sequence occurs (via network sniffer): -- a TCP connection is established -- the TCP connection is taken down (and the debug log shows a "responder: disconnect" event). The takedown is initiated by my application's side of the connection. -- the above two sequences are repeated, exactly -- a TCP connection is established for the third time, stays established, but then nothing else happens. Even a logon() call has no effect. If I run the same exact code with a debugger (I'm using IntelliJ Idea), and if I single-step over the call to initiator.start(), and if I have other threads suspended while single-stepping (all three conditions are necessary), then everything works just like you'd expect -- the connection at the TCP level is established on the first try, and the logon proceeds normally. While putzing around trying to imagine what the heck this could be, I discovered the hack: if I insert a delay (a sleep()) of 350 milliseconds or greater in the onCreate(SessionID) method of my Application, then everything works great, first time, every time. Does this ring a bell with anyone? BTW, I'm a newbie on QuickFIX/J, so don't dismiss any bozo maneuvers by saying to yourself "Nah, nobody could be that stupid!" Because yes I could. Thanks, Tom... |