RE: [Quickfix-developers] Quickfix/J: AbstractSocketInitiator issues
Brought to you by:
orenmnero
|
From: Brad H. <Bra...@gb...> - 2005-11-13 04:13:57
|
Hi Toby, The issue with quickfixSessions never being populated is Bug #106 - http://www.quickfixengine.org/bugtracker/bug.php?op=3Dshow&bugid=3D106&po= s=3D2 . As a workaround you can try something like this to get all the sessions: Map sessions =3D new HashMap(); // sessionSettings is the SessionSettings used to create the initiator. for (Iterator iter =3D sessionSettings.sectionIterator(); iter.hasNext();) { SessionID sessionId =3D (SessionID) iter.next(); Session session =3D Session.lookupSession(sessionId); if (session !=3D null) { sessions.put(sessionId, session); } } You can then check the status of each session. 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 -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of Shepheard, Toby (London) Sent: Friday, 11 November 2005 12:42 AM To: qui...@li... Subject: [Quickfix-developers] Quickfix/J: AbstractSocketInitiator issues QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html I'm using the latest version of Quickfix/J from CVS. I've just been switching my applications from an Acceptor to an Initiator and came across an issue with the Initiator code. The isLoggedOn and getSessions methods both use the quickfixSessions HashMap object. However, this HashMap is never populated - the AbstractSocketAcceptor populates it's version in the initialize method (first checking that the connectionType is an acceptor), but the AbstractSocketInitiator never does. As a result isLoggedOn will always return false, getSesssions an empty list, and there's no public way to get the current session status from the socket initiator. Is there some other way I can check to see the current login status from the SocketInitiator object (e.g. loginSent, loginReceived etc) for any active session? Should the quickfixSessions hashmap even exist in an Initiator, or should there be a single Session object which should be made avaialble via an accessor method? Or am I abusing all of this in some way and should I take a different approach? :) Many thanks, Toby -------------------------------------------------------- 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/ -------------------------------------------------------- ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |