Re: [Quickfix-developers] Socket Error when expecting a Logout message response
Brought to you by:
orenmnero
From: Shane T. <str...@co...> - 2008-03-13 15:55:50
|
It sounds like the counterparty is disconnecting before it sends the logout response. Could it be a problem on their end? The error in the QuickFIX log (Connection reset by peer) would seem like this is the case. Have you traced the network packets with Wireshark and tcpview to see precisely what is received/happening on the pipe? Also, are you handling the onLogout() callback to detect logouts during connection resets as opposed to onMessage(Logout)? -- Shane Trotter Connamara Systems, LLC On 3/13/08, Yoav <yo...@ya...> wrote: > Hi Shane and thanks for your reply. > What you suggested is more or less what I do and this > where I get the problem. > When I kill the process I call the lookupSession(), > then I call session->logout(). The Logout message is > being sent and the Initiator thread is about to read() > from the socket. Then *sometimes* the read() returns > an error. It's like something happens to the socket > (closed?) but I'm not sure what or why. > > The same problem happens when I use initiator.stop() > and not session->logout() > > > Yoav > > > --- Shane Trotter <str...@co...> wrote: > > > Yoav, > > > > You should send a > > Session.lookupSession(SessionID).logout() to force > > the logout and wait for a little while (possibly 30 > > seconds) using a > > loop similar to this: > > > > int ALITTLEWHILE = 30; > > for (int sec = 1; (sec <= ALITTLEWHILE) && > > Session.lookupSession(SessionID).isLoggedOn(); > > sec++) > > { > > Thread.Sleep(1000); > > } > > > > initiator.stop(); > > > > -- > > Shane Trotter > > Connamara Systems, LLC > > > > On 3/12/08, Yoav <yo...@ya...> wrote: > > > QuickFIX Documentation: > > > http://www.quickfixengine.org/quickfix/doc/html/index.html > > > QuickFIX Support: > > http://www.quickfixengine.org/services.html > > > > > > QuickFix version 1.12.4 (C++), Solaris 10 > > > > > > I'm implementing a clean shutdown in my FIX > > client. > > > When the process is being killed I send Logout > > message > > > on all my QF Initiator sessions. > > > > > > I see the following problem: > > > Sometimes everything works, meaning: I see the > > Logout > > > message being sent and the response being > > received. > > > But sometimes I see the Logout message being sent > > and > > > immediately I see an error: > > > "(Socket Error: Connection reset by peer.)" > > > > > > 2 comments: > > > 1) The 'peer' in my case is 'stunnel' which is > > doing > > > port forwarding > > > 2) During the time I kill my FIX process there > > are > > > incoming messages (MarketDataSnapshotFullRefresh) > > > > > > Any clue will be highly appreciated, > > > Yoav > > > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio > > 2008. > > > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > _______________________________________________ > > > Quickfix-developers mailing list > > > Qui...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > > > > |