RE: [Quickfix-developers] Quickfix/J: AbstractSocketInitiator issues
Brought to you by:
orenmnero
|
From: Shepheard, T. (London) <Tob...@ml...> - 2005-11-22 13:54:15
|
First of all, thanks Brad for the session workaround - worked a treat :) On the other issue, with the re-attempting connections...I got round to testing this myself and the problem is from the onTimer event. There's actually a fix to this already posted in bugzilla, see http://www.quickfixengine.org/bugtracker/bug.php?op=3Dshow&bugid=3D120&po= s=3D5 and in particular, the last part of Jeff's code. It'd be nice to get this added to CVS if nobody sees any problems with it; whilst the bug status says fixed, the last part doesn't seem to have made it in. For reference, here's the extract: quickfix.netty.AbstractSocketInitiator.SessionConnection.onTimerEvent() { if (!nettySession.isConnected() && quickfixSession.isEnabled() && isTimeForReconnect() && quickfixSession.isSessionTime()) { nettySession =3D (Session) nettySessions .get((nettySessions.indexOf(nettySession) + 1) % nettySessions.size()); lastReconnectAttemptTime =3D System.currentTimeMillis(); nettySession.start(); } // Delegate timer event to base class to it can hand off the event // to the appropriate thread //Added if statement, so higher layer events //Are not processed unless the connection is made. if( nettySession.isConnected() ) =09 AbstractSocketInitiator.this.onTimerEvent(quickfixSession); } } What was happening before is that the call to=20 AbstractSocketInitiator.this.onTimerEvent(quickfixSession); will eventually call quickfixSession.next(), which then sees its not logged on, calls the generateLogon() method which sets logonSent to true (regardless of what actually happens). Of course the generateLogon() call then fails to send the rawLogon as its not connected. After this point it *thinks* its sent the logon method so will never retry it. It would perhaps be also worth checking the return status of sendRaw in Session.generateLogon() - if this returns false then it could skip the call to state.setLogonSent(true). (@ Lines 1349-1350) Any comments from Oren or Steve & co welcomed! Regards, Toby -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of Brad Harvey Sent: 13 November 2005 04:14 To: qui...@li... Subject: RE: [Quickfix-developers] Quickfix/J: AbstractSocketInitiator issues <snip> I've actually run into a different issue with the initiator. It doesn't seem to logon properly after a failed connection attempt. Reproducing is fairly simple with Banzai and Order Matcher: 1. Start Banzai It gets a connection refused and periodically retries the connection as expected. 2. Start Order Matcher Banzai then logs this: <20051113-03:56:49, FIX.4.2:BANZAI->EXEC, event> (connection established: net.gleamynode.netty2.Session@afae4a) So it connects, but it doesn't seem to send a logon, and the order matcher logs nothing. The session doesn't show up in Banzai's drop down list of sessions. If I then restart Banzai it connects properly.=20 Regards, Brad. =20 <snip> -------------------------------------------------------- If you are not an intended recipient of this e-mail, please notify the = sender, delete it and do not read, act upon, print, disclose, copy, = retain or redistribute it. Click here for important additional terms = relating to this e-mail. http://www.ml.com/email_terms/ -------------------------------------------------------- |