Re: [Quickfix-developers] SeqNum not incrementing
Brought to you by:
orenmnero
|
From: Jain, A. <Ani...@rb...> - 2006-06-21 15:16:17
|
Let me hazard my guess:
When a logon is received and sent, and a heartbeat is sent, without an inte=
rvening test request, this bug will surface.
I base this on the following code:
It is clear the hearbeat is sent, and then msgSeqNum is incremented.
Yesterday, you must have received an intervening test request.
Regards,
Anil
QF code follows
---------------
bool needHeartbeat() const // In your case, this became true
{
UtcTimeStamp now;
return ( ( now - lastSentTime() ) >=3D heartBtInt() ) && !testRequest();
}
void Session::generateHeartbeat()
{ QF_STACK_PUSH(Session::generateHeartbeat)
Message heartbeat;
heartbeat.getHeader().setField( MsgType( "0" ) );
fill( heartbeat.getHeader() );
sendRaw( heartbeat );
bool Session::sendRaw( Message& message, int num ) // in this case, num=
=3D0
{=20
.=2E.
try
{
.=2E.
if ( num )
header.setField( MsgSeqNum( num ) );
if ( Message::isAdminMsgType( msgType ) )
{
m_application.toAdmin( message, m_sessionID );
if( msgType =3D=3D "A" && !m_state.receivedReset() )
{
.=2E.
}
message.toString( messageString );
if (
msgType =3D=3D "A" || msgType =3D=3D "5"
|| msgType =3D=3D "2" || msgType =3D=3D "4"
|| isLoggedOn() )
{
result =3D send( messageString ); // your message is sent without i=
ncrmenting num!
}
}
if ( !num ) // num is incremented too late!
{
MsgSeqNum msgSeqNum;
header.getField( msgSeqNum );
m_state.set( msgSeqNum, messageString );
m_state.incrNextSenderMsgSeqNum();
}
return result;
}
=20
-----Original Message-----
From: qui...@li...
[mailto:qui...@li...]On Behalf Of
Scott Riopelle
Sent: Wednesday, June 21, 2006 11:05 AM
To: dav...@ma...; qui...@li...
Subject: Re: [Quickfix-developers] SeqNum not incrementing
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/ind=
ex.html
QuickFIX Support: http://www.quickfixengine.org/services.html
As a test, I hacked out some code to detect the duplicate msgSeqNum sent
with the heartbeat, and automatically increment it as well as all
subsequent messages. This causes my application to work fine, despite
still not having sent the logonRequest message with ResetSeqNum field
set to Y. This doesn't strike me as appropriate behavior, should they
be persisting the connection without that message?
=09
-Scott
-----Original Message-----
From: qui...@li...
[mailto:qui...@li...] On Behalf Of
Scott Riopelle
Sent: Wednesday, June 21, 2006 10:58 AM
To: dav...@ma...; qui...@li...
Subject: Re: [Quickfix-developers] SeqNum not incrementing
QuickFIX Documentation:
http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html
I am using version 1.11.0
Is there a more recent one?
-Scott
-----Original Message-----
From: Dave Linaker [mailto:dav...@ma...]=20
Sent: Wednesday, June 21, 2006 10:42 AM
To: Scott Riopelle; qui...@li...
Subject: RE: [Quickfix-developers] SeqNum not incrementing
> Everything worked fine yesterday and I haven't had this=20
> problem before, but this morning, after I send a logon=20
> message with msgSeqNum =3D 1, and receive one back, I send a=20
> heartbeat also with msgSeqNum =3D 1. =20
>=20
> 8=3DFIX.4.2=019=3D0068=0135=3DA=0149=3DTMATS=0156=3DFORTFIX=0134=3D1=0152=
=3D20060621-13:
> 31:11=0198=3D0=01108=3D5=01141=3DY=0110=3D057=01
>=20
The Logon message you are receiving from "TMATS" has ResetSeqNumFlag=3DY
(i.e. the counterparty is requesting a reset of the sequence numbers),
which might explain the behaviour. Are you expecting this tag to be
set? Which version of quickfix are you using (I think there were some
fixes relating to ResetSeqNumFlag in 1.11.0)?
Cheers
Dave
_______________________________________________
Quickfix-developers mailing list
Qui...@li...
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
_______________________________________________
Quickfix-developers mailing list
Qui...@li...
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
_______________________________________________________________________
This E-Mail (including any attachments) may contain privileged or confident=
ial information. It is intended only for the addressee(s) indicated above.
The sender does not waive any of its rights, privileges or other protection=
s respecting this information. =20
Any distribution, copying or other use of this E-Mail or the information it=
contains, by other than an intended recipient, is not sanctioned and is pr=
ohibited.
If you received this E-Mail in error, please delete it and advise the sende=
r (by return E-Mail or otherwise) immediately.
This E-Mail (including any attachments) has been scanned for viruses.=20
It is believed to be free of any virus or other defect that might affect an=
y computer system into which it is received and opened.=20
However, it is the responsibility of the recipient to ensure that it is vir=
us free.=20
The sender accepts no responsibility for any loss or damage arising in any =
way from its use.
E-Mail received by or sent from RBC Capital Markets is subject to review by=
Supervisory personnel.=20
Such communications are retained and may be produced to regulatory authorit=
ies or others with legal rights to the information.
|