Re: [Quickfix-developers] Socket Error when expecting a Logout message response
Brought to you by:
orenmnero
From: Shane T. <str...@co...> - 2008-03-13 16:43:27
|
The only problem I have seen is disconnecting before receiving a logout response. The wait loop solved that problem. That said, I have never used QuickFIX through stunnel. I do not believe this is a QuickFIX issue though, as stunnel is disconnecting side. -- Shane Trotter Connamara Systems, LLC On 3/13/08, Yoav <yo...@ya...> wrote: > Hi Shane, > The counterparty is my case is a local 'stunnel' (this > is where my FIX client connects to and stunnel > forwards my messages to the "real" party). > I do see in the stunnel logs that the socket was > closed but I don't think (though I'm not sure) that it > was initiated by either stunnel or the real > coutnerparty. > > Did you ever see some problems with QF related to > logging out while receiving incoming messages? > > Regarding your second question: I'm not sure I > understand. What is the proper handling of onLogout() > (when I initiated the logout)? > (I don't use the message cracker so I don't use the > onMessage functions) > > Thanks! > > Yoav > > --- Shane Trotter <str...@co...> wrote: > > > 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 > > > > > > > > > > > > > > > > > > > |