Re: [Quickfix-developers] Disconnect socket meanwhile resending messages is treated when resent is
Brought to you by:
orenmnero
|
From: Tron F. <tr...@gm...> - 2007-11-07 13:25:12
|
Hi, I've just made this test (use isLoggedOn() to decide if we have to break the loop). But the function is returning always true while we are inside the loop. When the loop is finished, disconnection event is treated. This is how it works using quickfix-1.12.4, maybe with the last CVS version the m_state.sentLogon() variable is updated when disconnection happens Regards Abel On Nov 6, 2007 2:35 PM, Djalma Rosa dos Santos Filho <drs...@gm...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hi, > > I had this problem too. However, my solution was a little bit different, I am using some code from SNV trunk and I am not sure if in this newer version Session::send returns false for application messages if connection is broken, there are some changes in sendRaw. Thus, I preferred to check with isLoggedOn() to break the loop. > > Djalma > > On Nov 6, 2007 9:49 AM, Tron Fix <tr...@gm...> wrote: > > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > Hi all, > > > > I saw that when quickfix is resending messages (nextResendRequest > > function into Session class), it can happen a socket disconnection and > > the library is going on into this loop, saving messages into log but > > doing nothing with them (socket not longer exists). > > Maybe it could be added some control, so if socket failed to send a > > message, we go out the loop and stops resending. > > > > Now we have this lines to send the message ( Session.cpp:405 to 412) > > > > if ( resend( msg ) ) > > { > > if ( begin ) generateSequenceReset( begin, msgSeqNum ); > > send( msg.toString(messageString)); > > > > m_state.onEvent( "Resending Message: " > > + IntConvertor::convert( msgSeqNum ) ); > > begin = 0; > > > > This could be added: > > > > if ( resend( msg ) ) > > { > > if ( begin ) generateSequenceReset( begin, msgSeqNum ); > > // ** ADDED SOCKET CONTROL: send failed, break loop! > > if (!send( msg.toString(messageString) )) > > break; > > // *** > > m_state.onEvent( "Resending Message: " > > + IntConvertor::convert( msgSeqNum ) ); > > begin = 0; > > > > I tested in my quickfix application and it works, the application > > finishes resending when socket is disconnected. > > What do you think, do you see something wrong in this approach? > > > > Regards, > > Abel Monroy > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Quickfix-developers mailing list > > Qui...@li... > > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |