[Quickfix-developers] Disconnect socket meanwhile resending messages is treated when resent is fini
Brought to you by:
orenmnero
|
From: Tron F. <tr...@gm...> - 2007-11-06 11:49:17
|
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
|