Implemented a C++ client which establishes 8 sessions and reads from the server. The messages I process are Logon/Logoff/TradeCaptureReport and ExecutionReport.
My questions are below:
Should I keep track of received message sequence numbers and detect any missing message set and do a resend request or does FIX8 library handles this in the background? E.g when client crashes or there is a network problem.
While sending messages I have the code below to increase sequence number of outbound messages. When I use 1st code I receive different messages with the same sequence number(Tag34) within a single session. If I use the 2nd code(always return 1) I get nothing except logon messages.
int my_session_client::getNextSendSeqNo()
{
#if FIRST
_next_send_seq = ++send_seqnum;
return send_seqnum;
#else
return 1;
#endif
}
Above function is called in several message sending functions like below:
FIX8::Message *my_session_client::generate_sequence_reset(const unsigned newseqnum, const bool gapfillflag)
{
FIX8::Message *msg(Session::generate_sequence_reset(newseqnum, gapfillflag));
*msg << new FIX8::Paragon::SenderSubID(sender_subid_); /// crucial step.
msg->set_custom_seqnum(getNextSendSeqNo());
return msg;
}
BodyLength (9): 0
MsgType (35):
MsgSeqNum (34): 1
Logon ("A")
SenderSubID (50): **
EncryptMethod (98): 0
HeartBtInt (108): 36000
ResetSeqNumFlag (141): Y
Username (553): **
Password (554): ****
DefaultApplVerID (1137): 9
trailer ("trailer")
CheckSum (10):
msg->set_custom_seqnum(1);
*msg->Header() << new FIX8::My::MsgSeqNum(1)
/dakka