Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
FIX::Session Class Reference

Maintains the state and implements the logic of a FIX session. More...

#include <Session.h>

Collaboration diagram for FIX::Session:
Collaboration graph
[legend]

Public Member Functions

 Session (Application &, MessageStoreFactory &, const SessionID &, const DataDictionaryProvider &, const TimeRange &, int heartBtInt, LogFactory *pLogFactory)
 
virtual ~Session ()
 
void logon ()
 
void logout (const std::string &reason="")
 
bool isEnabled ()
 
bool sentLogon ()
 
bool sentLogout ()
 
bool receivedLogon ()
 
bool isLoggedOn ()
 
void reset () throw ( IOException )
 
void refresh () throw ( IOException )
 
void setNextSenderMsgSeqNum (int num) throw ( IOException )
 
void setNextTargetMsgSeqNum (int num) throw ( IOException )
 
const SessionIDgetSessionID () const
 
void setDataDictionaryProvider (const DataDictionaryProvider &dataDictionaryProvider)
 
const DataDictionaryProvidergetDataDictionaryProvider () const
 
bool isSessionTime (const UtcTimeStamp &time)
 
bool isLogonTime (const UtcTimeStamp &time)
 
bool isInitiator ()
 
bool isAcceptor ()
 
const TimeRangegetLogonTime ()
 
void setLogonTime (const TimeRange &value)
 
const std::string & getSenderDefaultApplVerID ()
 
void setSenderDefaultApplVerID (const std::string &senderDefaultApplVerID)
 
const std::string & getTargetDefaultApplVerID ()
 
void setTargetDefaultApplVerID (const std::string &targetDefaultApplVerID)
 
bool getSendRedundantResendRequests ()
 
void setSendRedundantResendRequests (bool value)
 
bool getCheckCompId ()
 
void setCheckCompId (bool value)
 
bool getCheckLatency ()
 
void setCheckLatency (bool value)
 
int getMaxLatency ()
 
void setMaxLatency (int value)
 
int getLogonTimeout ()
 
void setLogonTimeout (int value)
 
int getLogoutTimeout ()
 
void setLogoutTimeout (int value)
 
bool getResetOnLogon ()
 
void setResetOnLogon (bool value)
 
bool getResetOnLogout ()
 
void setResetOnLogout (bool value)
 
bool getResetOnDisconnect ()
 
void setResetOnDisconnect (bool value)
 
bool getRefreshOnLogon ()
 
void setRefreshOnLogon (bool value)
 
bool getMillisecondsInTimeStamp ()
 
void setMillisecondsInTimeStamp (bool value)
 
int getTimestampPrecision ()
 
void setTimestampPrecision (int precision)
 
bool getPersistMessages ()
 
void setPersistMessages (bool value)
 
bool getValidateLengthAndChecksum ()
 
void setValidateLengthAndChecksum (bool value)
 
void setResponder (Responder *pR)
 
bool send (Message &)
 
void next ()
 
void next (const UtcTimeStamp &timeStamp)
 
void next (const std::string &, const UtcTimeStamp &timeStamp, bool queued=false)
 
void next (const Message &, const UtcTimeStamp &timeStamp, bool queued=false)
 
void disconnect ()
 
int getExpectedSenderNum ()
 
int getExpectedTargetNum ()
 
LoggetLog ()
 
const MessageStoregetStore ()
 
const HeartBtInt & getHeartBtInt () const
 

Static Public Member Functions

static bool sendToTarget (Message &message, const std::string &qualifier="") throw ( SessionNotFound )
 
static bool sendToTarget (Message &message, const SessionID &sessionID) throw ( SessionNotFound )
 
static bool sendToTarget (Message &, const SenderCompID &senderCompID, const TargetCompID &targetCompID, const std::string &qualifier="") throw ( SessionNotFound )
 
static bool sendToTarget (Message &message, const std::string &senderCompID, const std::string &targetCompID, const std::string &qualifier="") throw ( SessionNotFound )
 
static std::set< SessionIDgetSessions ()
 
static bool doesSessionExist (const SessionID &)
 
static SessionlookupSession (const SessionID &)
 
static SessionlookupSession (const std::string &, bool reverse=false)
 
static bool isSessionRegistered (const SessionID &)
 
static SessionregisterSession (const SessionID &)
 
static void unregisterSession (const SessionID &)
 
static size_t numSessions ()
 

Private Types

typedef std::map< SessionID, Session * > Sessions
 
typedef std::set< SessionIDSessionIDs
 

Private Member Functions

bool send (const std::string &)
 
bool sendRaw (Message &, int msgSeqNum=0)
 
bool resend (Message &message)
 
void persist (const Message &, const std::string &) throw ( IOException )
 
void insertSendingTime (Header &)
 
void insertOrigSendingTime (Header &, const UtcTimeStamp &when=UtcTimeStamp())
 
void fill (Header &)
 
bool isGoodTime (const SendingTime &sendingTime)
 
bool checkSessionTime (const UtcTimeStamp &timeStamp)
 
bool isTargetTooHigh (const MsgSeqNum &msgSeqNum)
 
bool isTargetTooLow (const MsgSeqNum &msgSeqNum)
 
bool isCorrectCompID (const SenderCompID &senderCompID, const TargetCompID &targetCompID)
 
bool shouldSendReset ()
 
bool validLogonState (const MsgType &msgType)
 
void fromCallback (const MsgType &msgType, const Message &msg, const SessionID &sessionID)
 
void doBadTime (const Message &msg)
 
void doBadCompID (const Message &msg)
 
bool doPossDup (const Message &msg)
 
bool doTargetTooLow (const Message &msg)
 
void doTargetTooHigh (const Message &msg)
 
void nextQueued (const UtcTimeStamp &timeStamp)
 
bool nextQueued (int num, const UtcTimeStamp &timeStamp)
 
void nextLogon (const Message &, const UtcTimeStamp &timeStamp)
 
void nextHeartbeat (const Message &, const UtcTimeStamp &timeStamp)
 
void nextTestRequest (const Message &, const UtcTimeStamp &timeStamp)
 
void nextLogout (const Message &, const UtcTimeStamp &timeStamp)
 
void nextReject (const Message &, const UtcTimeStamp &timeStamp)
 
void nextSequenceReset (const Message &, const UtcTimeStamp &timeStamp)
 
void nextResendRequest (const Message &, const UtcTimeStamp &timeStamp)
 
void generateLogon ()
 
void generateLogon (const Message &)
 
void generateResendRequest (const BeginString &, const MsgSeqNum &)
 
void generateSequenceReset (int, int)
 
void generateHeartbeat ()
 
void generateHeartbeat (const Message &)
 
void generateTestRequest (const std::string &)
 
void generateReject (const Message &, int err, int field=0)
 
void generateReject (const Message &, const std::string &)
 
void generateBusinessReject (const Message &, int err, int field=0)
 
void generateLogout (const std::string &text="")
 
void populateRejectReason (Message &, int field, const std::string &)
 
void populateRejectReason (Message &, const std::string &)
 
bool verify (const Message &msg, bool checkTooHigh=true, bool checkTooLow=true)
 
bool set (int s, const Message &m)
 
bool get (int s, Message &m) const
 
MessagenewMessage (const std::string &msgType) const
 

Static Private Member Functions

static bool addSession (Session &)
 
static void removeSession (Session &)
 

Private Attributes

Applicationm_application
 
SessionID m_sessionID
 
TimeRange m_sessionTime
 
TimeRange m_logonTime
 
std::string m_senderDefaultApplVerID
 
std::string m_targetDefaultApplVerID
 
bool m_sendRedundantResendRequests
 
bool m_checkCompId
 
bool m_checkLatency
 
int m_maxLatency
 
bool m_resetOnLogon
 
bool m_resetOnLogout
 
bool m_resetOnDisconnect
 
bool m_refreshOnLogon
 
int m_timestampPrecision
 
bool m_persistMessages
 
bool m_validateLengthAndChecksum
 
SessionState m_state
 
DataDictionaryProvider m_dataDictionaryProvider
 
MessageStoreFactorym_messageStoreFactory
 
LogFactorym_pLogFactory
 
Responderm_pResponder
 
Mutex m_mutex
 

Static Private Attributes

static Sessions s_sessions
 
static SessionIDs s_sessionIDs
 
static Sessions s_registered
 
static Mutex s_mutex
 

Detailed Description

Maintains the state and implements the logic of a FIX session.

Definition at line 60 of file Session.h.

Member Typedef Documentation

◆ SessionIDs

typedef std::set< SessionID > FIX::Session::SessionIDs
private

Definition at line 265 of file Session.h.

◆ Sessions

typedef std::map< SessionID, Session* > FIX::Session::Sessions
private

Definition at line 264 of file Session.h.

Constructor & Destructor Documentation

◆ Session()

FIX::Session::Session ( Application application,
MessageStoreFactory messageStoreFactory,
const SessionID sessionID,
const DataDictionaryProvider dataDictionaryProvider,
const TimeRange sessionTime,
int  heartBtInt,
LogFactory pLogFactory 
)

Definition at line 56 of file Session.cpp.

68 {
69  m_state.heartBtInt( heartBtInt );
70  m_state.initiate( heartBtInt != 0 );
72  if ( m_pLogFactory )
74 
76  reset();
77 
78  addSession( *this );
80  m_state.onEvent( "Created session" );
81 }
82 
84 {
85  removeSession( *this );
87  if ( m_pLogFactory && m_state.log() )
89 }
90 
91 void Session::insertSendingTime( Header& header )
92 {
93  UtcTimeStamp now;
94  bool showMilliseconds = false;
96  showMilliseconds = true;

References FIX::TYPE::UtcTimeStamp.

◆ ~Session()

FIX::Session::~Session ( )
virtual

Definition at line 98 of file Session.cpp.

100  : 0) );
101 }
102 
103 void Session::insertOrigSendingTime( Header& header, const UtcTimeStamp& when )
104 {

Member Function Documentation

◆ addSession()

bool FIX::Session::addSession ( Session s)
staticprivate

Definition at line 1574 of file Session.cpp.

1574 {
1575  Locker locker( s_mutex );
1576  s_sessions.erase( s.m_sessionID );
1577  s_sessionIDs.erase( s.m_sessionID );
1578  s_registered.erase( s.m_sessionID );
1579 }
1580 }

References s_mutex, s_registered, s_sessionIDs, and s_sessions.

◆ checkSessionTime()

bool FIX::Session::checkSessionTime ( const UtcTimeStamp timeStamp)
inlineprivate

Definition at line 286 of file Session.h.

Referenced by fill(), and setRefreshOnLogon().

◆ disconnect()

void FIX::Session::disconnect ( )

Definition at line 628 of file Session.cpp.

644 {
645  SendingTime sendingTime;
646  MsgSeqNum msgSeqNum;
647  Header& header = message.getHeader();
648  header.getField( sendingTime );
649  header.getField( msgSeqNum );
650  insertOrigSendingTime( header, sendingTime );
651  header.setField( PossDupFlag( true ) );
652  insertSendingTime( header );
653 
654  try
655  {
656  m_application.toApp( message, m_sessionID );

Referenced by FIX::SocketInitiator::onDisconnect(), and FIX::SocketAcceptor::onWrite().

◆ doBadCompID()

void FIX::Session::doBadCompID ( const Message msg)
private

Definition at line 1167 of file Session.cpp.

1169  {
1170  if ( !header.getFieldIfSet( origSendingTime ) )
1171  {

References generateReject(), and FIX::FieldMap::getFieldIfSet().

◆ doBadTime()

void FIX::Session::doBadTime ( const Message msg)
private

Definition at line 1161 of file Session.cpp.

1169  {

◆ doesSessionExist()

bool FIX::Session::doesSessionExist ( const SessionID sessionID)
static

Definition at line 1505 of file Session.cpp.

1507 {
1508  Message message;
1509  if ( !message.setStringHeader( string ) )

References FIX::Message::setStringHeader().

◆ doPossDup()

bool FIX::Session::doPossDup ( const Message msg)
private

Definition at line 1173 of file Session.cpp.

1177  {
1178  generateReject( msg, SessionRejectReason_SENDINGTIME_ACCURACY_PROBLEM );
1179  generateLogout();
1180  return false;
1181  }
1182  }
1183  return true;
1184 }
1185 
1186 bool Session::doTargetTooLow( const Message& msg )
1187 {
1188  const Header & header = msg.getHeader();
1189  PossDupFlag possDupFlag(false);
1190  MsgSeqNum msgSeqNum;
1191  header.getFieldIfSet(possDupFlag);
1192  header.getField( msgSeqNum );
1193 
1194  if ( !possDupFlag )
1195  {
1196  std::stringstream stream;
1197  stream << "MsgSeqNum too low, expecting " << getExpectedTargetNum()
1198  << " but received " << msgSeqNum;
1199  generateLogout( stream.str() );

◆ doTargetTooHigh()

void FIX::Session::doTargetTooHigh ( const Message msg)
private

Definition at line 1221 of file Session.cpp.

1222  {
1224 
1225  if( !m_sendRedundantResendRequests && msgSeqNum >= range.first )
1226  {
1227  m_state.onEvent ("Already sent ResendRequest FROM: " +
1228  IntConvertor::convert (range.first) + " TO: " +
1229  IntConvertor::convert (range.second) +
1230  ". Not sending another.");
1231  return;
1232  }
1233  }
1234 
1235  generateResendRequest( beginString, msgSeqNum );
1236 }
1237 
1238 void Session::nextQueued( const UtcTimeStamp& timeStamp )
1239 {
1240  while ( nextQueued( getExpectedTargetNum(), timeStamp ) ) {}
1241 }
1242 
1243 bool Session::nextQueued( int num, const UtcTimeStamp& timeStamp )
1244 {
1245  Message msg;
1246  MsgType msgType;
1247 
1248  if( m_state.retrieve( num, msg ) )
1249  {
1250  m_state.onEvent( "Processing QUEUED message: "
1251  + IntConvertor::convert( num ) );

References FIX::IntConvertor::convert(), m_sendRedundantResendRequests, m_state, FIX::SessionState::onEvent(), and FIX::SessionState::resendRange().

◆ doTargetTooLow()

bool FIX::Session::doTargetTooLow ( const Message msg)
private

Definition at line 1201 of file Session.cpp.

1207 {
1208  const Header & header = msg.getHeader();
1209  BeginString beginString;
1210  MsgSeqNum msgSeqNum;
1211  header.getField( beginString );
1212  header.getField( msgSeqNum );
1213 
1214  m_state.onEvent( "MsgSeqNum too high, expecting "
1216  + " but received "
1217  + IntConvertor::convert( msgSeqNum ) );
1218 
1219  m_state.queue( msgSeqNum, msg );

◆ fill()

void FIX::Session::fill ( Header header)
private

Definition at line 129 of file Session.cpp.

131 {
132  try
133  {
134  if ( !checkSessionTime(timeStamp) )
135  { reset(); return; }
136 
137  if( !isEnabled() || !isLogonTime(timeStamp) )
138  {

References checkSessionTime(), isEnabled(), isLoggedOn(), isLogonTime(), and reset().

◆ fromCallback()

void FIX::Session::fromCallback ( const MsgType &  msgType,
const Message msg,
const SessionID sessionID 
)
private

Definition at line 1152 of file Session.cpp.

1153 {
1154  generateReject( msg, SessionRejectReason_COMPID_PROBLEM );
1155  generateLogout();
1156 }
1157 
1158 bool Session::doPossDup( const Message& msg )
1159 {

References generateLogout(), and generateReject().

◆ generateBusinessReject()

void FIX::Session::generateBusinessReject ( const Message message,
int  err,
int  field = 0 
)
private

Definition at line 946 of file Session.cpp.

951  {
952  case BusinessRejectReason_OTHER:
954  break;
955  case BusinessRejectReason_UNKNOWN_ID:
957  break;
958  case BusinessRejectReason_UNKNOWN_SECURITY:
960  break;
961  case BusinessRejectReason_UNKNOWN_MESSAGE_TYPE:
963  break;
964  case BusinessRejectReason_APPLICATION_NOT_AVAILABLE:
966  break;
967  case BusinessRejectReason_CONDITIONALLY_REQUIRED_FIELD_MISSING:
969  break;
970  case BusinessRejectReason_NOT_AUTHORIZED:
972  break;
973  case BusinessRejectReason_DELIVERTO_FIRM_NOT_AVAILABLE_AT_THIS_TIME:
975  break;
976  };
977 
978  if ( reason && field )
979  {
980  populateRejectReason( reject, field, reason );
981  m_state.onEvent( "Message " + msgSeqNum.getString() + " Rejected: "
982  + reason + ":" + IntConvertor::convert( field ) );
983  }
984  else if ( reason )
985  {
986  populateRejectReason( reject, reason );
987  m_state.onEvent( "Message " + msgSeqNum.getString()
988  + " Rejected: " + reason );
989  }
990  else
991  m_state.onEvent( "Message " + msgSeqNum.getString() + " Rejected" );
992 
993  sendRaw( reject );
994 }
995 
996 void Session::generateLogout( const std::string& text )
997 {
998  SmartPtr<Message> pMsg(newMessage("5"));
999  Message & logout = *pMsg;
1000 
1001  logout.getHeader().setField( MsgType( MsgType_Logout ) );
1002  fill( logout.getHeader() );
1003  if ( text.length() )
1004  logout.setField( Text( text ) );
1005  sendRaw( logout );
1006  m_state.sentLogout( true );
1007 }
1008 
1009 void Session::populateRejectReason( Message& reject, int field,

References FIX::BusinessRejectReason_APPLICATION_NOT_AVAILABLE_TEXT, FIX::BusinessRejectReason_CONDITIONALLY_REQUIRED_FIELD_MISSING_TEXT, FIX::BusinessRejectReason_DELIVERTO_FIRM_NOT_AVAILABLE_AT_THIS_TIME_TEXT, FIX::BusinessRejectReason_NOT_AUTHORIZED_TEXT, FIX::BusinessRejectReason_OTHER_TEXT, FIX::BusinessRejectReason_UNKNOWN_ID_TEXT, FIX::BusinessRejectReason_UNKNOWN_SECURITY_TEXT, and FIX::BusinessRejectReason_UNSUPPORTED_MESSAGE_TYPE_TEXT.

◆ generateHeartbeat() [1/2]

void FIX::Session::generateHeartbeat ( )
private

Definition at line 779 of file Session.cpp.

782  {
783  TestReqID testReqID;
784  testRequest.getField( testReqID );
785  heartbeat.setField( testReqID );
786  }
787  catch ( FieldNotFound& ) {}

◆ generateHeartbeat() [2/2]

void FIX::Session::generateHeartbeat ( const Message testRequest)
private

Definition at line 789 of file Session.cpp.

793 {
794  SmartPtr<Message> pMsg(newMessage("1"));
795  Message & testRequest = *pMsg;
796 
797  testRequest.getHeader().setField( MsgType( "1" ) );
798  fill( testRequest.getHeader() );
799  TestReqID testReqID( id );
800  testRequest.setField( testReqID );
801 
802  sendRaw( testRequest );
803 }
804 
805 void Session::generateReject( const Message& message, int err, int field )

◆ generateLogon() [1/2]

void FIX::Session::generateLogon ( )
private

Definition at line 688 of file Session.cpp.

699 {
700  SmartPtr<Message> pMsg(newMessage("A"));
701  Message & logon = *pMsg;
702 
703  EncryptMethod encryptMethod;
704  HeartBtInt heartBtInt;
705  logon.setField( EncryptMethod( 0 ) );
706  if( m_sessionID.isFIXT() )
707  logon.setField( DefaultApplVerID(m_senderDefaultApplVerID) );
708  if( m_state.receivedReset() )
709  logon.setField( ResetSeqNumFlag(true) );
710  aLogon.getField( heartBtInt );
711  logon.getHeader().setField( MsgType( "A" ) );

◆ generateLogon() [2/2]

void FIX::Session::generateLogon ( const Message aLogon)
private

Definition at line 713 of file Session.cpp.

719 {
720  SmartPtr<Message> pMsg(newMessage("2"));
721  Message & resendRequest = *pMsg;
722 
723  BeginSeqNo beginSeqNo( ( int ) getExpectedTargetNum() );
724  EndSeqNo endSeqNo( msgSeqNum - 1 );
725  if ( beginString >= FIX::BeginString_FIX42 )
726  endSeqNo = 0;
727  else if( beginString <= FIX::BeginString_FIX41 )
728  endSeqNo = 999999;
729  resendRequest.getHeader().setField( MsgType( "2" ) );
730  resendRequest.setField( beginSeqNo );
731  resendRequest.setField( endSeqNo );

◆ generateLogout()

void FIX::Session::generateLogout ( const std::string &  text = "")
private

Definition at line 1011 of file Session.cpp.

1011 {
1012  MsgType msgType;
1013  reject.getHeader().getField( msgType );
1014 
1015  if ( msgType == MsgType_Reject
1017  {
1018  reject.setField( RefTagID( field ) );
1019  reject.setField( Text( text ) );
1020  }
1021  else
1022  {

References FIX::BeginString_FIX42, FIX::SessionID::getBeginString(), and m_sessionID.

Referenced by fromCallback(), next(), and nextHeartbeat().

◆ generateReject() [1/2]

void FIX::Session::generateReject ( const Message message,
const std::string &  str 
)
private

Definition at line 917 of file Session.cpp.

928  : " + str );
929 }
930 
931 void Session::generateBusinessReject( const Message& message, int err, int field )
932 {
933  SmartPtr<Message> pMsg(newMessage("j"));
934  Message & reject = *pMsg;
935 
936  reject.getHeader().setField( MsgType( MsgType_BusinessMessageReject ) );
937  if( m_sessionID.isFIXT() )
938  reject.setField( DefaultApplVerID(m_senderDefaultApplVerID) );
939  fill( reject.getHeader() );
940  MsgType msgType;
941  MsgSeqNum msgSeqNum;
942  message.getHeader().getField( msgType );
943  message.getHeader().getField( msgSeqNum );
944  reject.setField( RefMsgType( msgType ) );

◆ generateReject() [2/2]

void FIX::Session::generateReject ( const Message message,
int  err,
int  field = 0 
)
private

Definition at line 820 of file Session.cpp.

821  {
822  if( msgSeqNum.getString() != "" )
823  reject.setField( RefSeqNum( msgSeqNum ) );
824  }
825 
826  if ( beginString >= FIX::BeginString_FIX42 )
827  {
828  if( msgType.getString() != "" )
829  reject.setField( RefMsgType( msgType ) );
830  if ( (beginString == FIX::BeginString_FIX42
831  && err <= SessionRejectReason_INVALID_MSGTYPE)
832  || beginString > FIX::BeginString_FIX42 )
833  {
834  reject.setField( SessionRejectReason( err ) );
835  }
836  }
837  if ( msgType != MsgType_Logon && msgType != MsgType_SequenceReset
838  && msgSeqNum == getExpectedTargetNum() )
840 
841  const char* reason = 0;
842  switch ( err )
843  {
844  case SessionRejectReason_INVALID_TAG_NUMBER:
846  break;
847  case SessionRejectReason_REQUIRED_TAG_MISSING:
849  break;
850  case SessionRejectReason_TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE:
852  break;
853  case SessionRejectReason_TAG_SPECIFIED_WITHOUT_A_VALUE:
855  break;
856  case SessionRejectReason_VALUE_IS_INCORRECT:
858  break;
859  case SessionRejectReason_INCORRECT_DATA_FORMAT_FOR_VALUE:
861  break;
862  case SessionRejectReason_COMPID_PROBLEM:
864  break;
865  case SessionRejectReason_SENDINGTIME_ACCURACY_PROBLEM:
867  break;
868  case SessionRejectReason_INVALID_MSGTYPE:
870  break;
871  case SessionRejectReason_TAG_APPEARS_MORE_THAN_ONCE:
873  break;
874  case SessionRejectReason_TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER:
876  break;
877  case SessionRejectReason_INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP:
879  };
880 
881  if ( reason && ( field || err == SessionRejectReason_INVALID_TAG_NUMBER ) )
882  {
883  populateRejectReason( reject, field, reason );
884  m_state.onEvent( "Message " + msgSeqNum.getString() + " Rejected: "
885  + reason + ":" + IntConvertor::convert( field ) );
886  }
887  else if ( reason )
888  {
889  populateRejectReason( reject, reason );
890  m_state.onEvent( "Message " + msgSeqNum.getString()
891  + " Rejected: " + reason );
892  }
893  else
894  m_state.onEvent( "Message " + msgSeqNum.getString() + " Rejected" );
895 
896  if ( !m_state.receivedLogon() )
897  throw std::runtime_error( "Tried to send a reject while not logged on" );
898 
899  sendRaw( reject );
900 }
901 
902 void Session::generateReject( const Message& message, const std::string& str )
903 {
904  std::string beginString = m_sessionID.getBeginString();
905 
906  SmartPtr<Message> pMsg(newMessage("3"));
907  Message & reject = *pMsg;
908 
909  reject.getHeader().setField( MsgType( "3" ) );
910  reject.reverseRoute( message.getHeader() );
911  fill( reject.getHeader() );
912 
913  MsgType msgType;
914  MsgSeqNum msgSeqNum;
915 

References FIX::FieldMap::setField().

Referenced by doBadCompID(), and fromCallback().

◆ generateResendRequest()

void FIX::Session::generateResendRequest ( const BeginString &  beginString,
const MsgSeqNum &  msgSeqNum 
)
private

Definition at line 733 of file Session.cpp.

735  : "
736  + IntConvertor::convert( beginSeqNo ) +
737  " TO: " + IntConvertor::convert( endSeqNo ) );
738 
739  m_state.resendRange( beginSeqNo, msgSeqNum - 1 );
740 }
741 
742 void Session::generateSequenceReset
743 ( int beginSeqNo, int endSeqNo )
744 {
745  SmartPtr<Message> pMsg(newMessage("4"));
746  Message & sequenceReset = *pMsg;
747 
748  NewSeqNo newSeqNo( endSeqNo );
749  sequenceReset.getHeader().setField( MsgType( "4" ) );
750  sequenceReset.getHeader().setField( PossDupFlag( true ) );
751  sequenceReset.setField( newSeqNo );
752  fill( sequenceReset.getHeader() );
753 
754  SendingTime sendingTime;
755  sequenceReset.getHeader().getField( sendingTime );

◆ generateSequenceReset()

void FIX::Session::generateSequenceReset ( int  beginSeqNo,
int  endSeqNo 
)
private

Definition at line 758 of file Session.cpp.

760  : "
761  + IntConvertor::convert( newSeqNo ) );
762 }
763 
764 void Session::generateHeartbeat()
765 {
766  SmartPtr<Message> pMsg(newMessage("0"));
767  Message & heartbeat = *pMsg;
768 
769  heartbeat.getHeader().setField( MsgType( "0" ) );
770  fill( heartbeat.getHeader() );
771  sendRaw( heartbeat );
772 }
773 
774 void Session::generateHeartbeat( const Message& testRequest )
775 {
776  SmartPtr<Message> pMsg(newMessage("0"));
777  Message & heartbeat = *pMsg;

◆ generateTestRequest()

void FIX::Session::generateTestRequest ( const std::string &  id)
private

Definition at line 807 of file Session.cpp.

821  {

◆ get()

bool FIX::Session::get ( int  s,
Message m 
) const
private

◆ getCheckCompId()

bool FIX::Session::getCheckCompId ( )
inline

Definition at line 168 of file Session.h.

168  { return m_resetOnLogout; }
169  void setResetOnLogout ( bool value )

References m_resetOnLogout.

Referenced by FIX::HttpConnection::processSession().

◆ getCheckLatency()

bool FIX::Session::getCheckLatency ( )
inline

Definition at line 173 of file Session.h.

173  { return m_resetOnDisconnect; }
174  void setResetOnDisconnect( bool value )

References m_resetOnDisconnect.

Referenced by FIX::HttpConnection::processSession().

◆ getDataDictionaryProvider()

const DataDictionaryProvider& FIX::Session::getDataDictionaryProvider ( ) const
inline

Definition at line 110 of file Session.h.

111  { return m_logonTime.isInRange(time); }

References FIX::TimeRange::isInRange(), and m_logonTime.

◆ getExpectedSenderNum()

int FIX::Session::getExpectedSenderNum ( )
inline

◆ getExpectedTargetNum()

int FIX::Session::getExpectedTargetNum ( )
inline

◆ getHeartBtInt()

const HeartBtInt& FIX::Session::getHeartBtInt ( ) const
inline

Definition at line 261 of file Session.h.

261 { return msgSeqNum > ( m_state.getNextTargetMsgSeqNum() ); }

References FIX::SessionState::getNextTargetMsgSeqNum(), and m_state.

◆ getLog()

Log* FIX::Session::getLog ( )
inline

Definition at line 258 of file Session.h.

261 { return msgSeqNum > ( m_state.getNextTargetMsgSeqNum() ); }

Referenced by FIX::SocketConnection::disconnect().

◆ getLogonTime()

const TimeRange& FIX::Session::getLogonTime ( )
inline

Definition at line 148 of file Session.h.

148  { return m_maxLatency; }
149  void setMaxLatency ( int value )

References m_maxLatency.

◆ getLogonTimeout()

int FIX::Session::getLogonTimeout ( )
inline

Definition at line 183 of file Session.h.

183  { return (m_timestampPrecision == 3); }
184  void setMillisecondsInTimeStamp ( bool value )

References m_timestampPrecision.

Referenced by FIX::HttpConnection::processSession().

◆ getLogoutTimeout()

int FIX::Session::getLogoutTimeout ( )
inline

Definition at line 188 of file Session.h.

191  { return m_timestampPrecision; }

Referenced by FIX::HttpConnection::processSession().

◆ getMaxLatency()

int FIX::Session::getMaxLatency ( )
inline

Definition at line 178 of file Session.h.

178  { return m_refreshOnLogon; }
179  void setRefreshOnLogon( bool value )

References m_refreshOnLogon.

Referenced by FIX::HttpConnection::processSession().

◆ getMillisecondsInTimeStamp()

bool FIX::Session::getMillisecondsInTimeStamp ( )
inline

Definition at line 213 of file Session.h.

Referenced by FIX::HttpConnection::processSession().

◆ getPersistMessages()

bool FIX::Session::getPersistMessages ( )
inline

Definition at line 231 of file Session.h.

232  :
233  typedef std::map < SessionID, Session* > Sessions;

Referenced by FIX::HttpConnection::processSession().

◆ getRefreshOnLogon()

bool FIX::Session::getRefreshOnLogon ( )
inline

Definition at line 208 of file Session.h.

208  { m_validateLengthAndChecksum = value; }
209 

References m_validateLengthAndChecksum.

Referenced by FIX::HttpConnection::processSession().

◆ getResetOnDisconnect()

bool FIX::Session::getResetOnDisconnect ( )
inline

Definition at line 203 of file Session.h.

203  { m_persistMessages = value; }
204 

References m_persistMessages.

Referenced by FIX::HttpConnection::processSession().

◆ getResetOnLogon()

bool FIX::Session::getResetOnLogon ( )
inline

Definition at line 193 of file Session.h.

193  {
194  if (precision < 0 || precision > 9)

Referenced by FIX::HttpConnection::processSession().

◆ getResetOnLogout()

bool FIX::Session::getResetOnLogout ( )
inline

Definition at line 198 of file Session.h.

201  { return m_persistMessages; }

Referenced by FIX::HttpConnection::processSession().

◆ getSenderDefaultApplVerID()

const std::string& FIX::Session::getSenderDefaultApplVerID ( )
inline

Definition at line 153 of file Session.h.

153  { return m_state.logonTimeout(); }
154  void setLogonTimeout ( int value )

References FIX::SessionState::logonTimeout(), and m_state.

Referenced by FIX::MessageCracker::crack().

◆ getSendRedundantResendRequests()

bool FIX::Session::getSendRedundantResendRequests ( )
inline

Definition at line 163 of file Session.h.

163  { return m_resetOnLogon; }
164  void setResetOnLogon ( bool value )

References m_resetOnLogon.

Referenced by FIX::HttpConnection::processSession().

◆ getSessionID()

const SessionID& FIX::Session::getSessionID ( ) const
inline

Definition at line 106 of file Session.h.

109  { return m_sessionTime.isInRange(time); }

Referenced by FIX::SocketInitiator::onDisconnect().

◆ getSessions()

std::set< SessionID > FIX::Session::getSessions ( )
static

◆ getStore()

const MessageStore* FIX::Session::getStore ( )
inline

Definition at line 259 of file Session.h.

261 { return msgSeqNum > ( m_state.getNextTargetMsgSeqNum() ); }

◆ getTargetDefaultApplVerID()

const std::string& FIX::Session::getTargetDefaultApplVerID ( )
inline

Definition at line 158 of file Session.h.

158  { return m_state.logoutTimeout(); }
159  void setLogoutTimeout ( int value )

References FIX::SessionState::logoutTimeout(), and m_state.

◆ getTimestampPrecision()

int FIX::Session::getTimestampPrecision ( )
inline

Definition at line 221 of file Session.h.

224  { return m_state.getNextSenderMsgSeqNum(); }

◆ getValidateLengthAndChecksum()

bool FIX::Session::getValidateLengthAndChecksum ( )
inline

Definition at line 236 of file Session.h.

◆ insertOrigSendingTime()

void FIX::Session::insertOrigSendingTime ( Header header,
const UtcTimeStamp when = UtcTimeStamp () 
)
private

Definition at line 118 of file Session.cpp.

126 {
127  next( UtcTimeStamp() );

◆ insertSendingTime()

void FIX::Session::insertSendingTime ( Header header)
private

Definition at line 106 of file Session.cpp.

111  : 0) );
112 }
113 
114 void Session::fill( Header& header )
115 {
116  UtcTimeStamp now;

◆ isAcceptor()

bool FIX::Session::isAcceptor ( )
inline

Definition at line 145 of file Session.h.

145  { m_checkLatency = value; }
146 

References m_checkLatency.

◆ isCorrectCompID()

bool FIX::Session::isCorrectCompID ( const SenderCompID &  senderCompID,
const TargetCompID &  targetCompID 
)
inlineprivate

Definition at line 295 of file Session.h.

◆ isEnabled()

bool FIX::Session::isEnabled ( )
inline

◆ isGoodTime()

bool FIX::Session::isGoodTime ( const SendingTime &  sendingTime)
inlineprivate

Definition at line 280 of file Session.h.

◆ isInitiator()

bool FIX::Session::isInitiator ( )
inline

Definition at line 143 of file Session.h.

143  { return m_checkLatency; }
144  void setCheckLatency ( bool value )

References m_checkLatency.

Referenced by FIX::HttpConnection::processRoot(), and FIX::HttpConnection::processSession().

◆ isLoggedOn()

bool FIX::Session::isLoggedOn ( )
inline

◆ isLogonTime()

bool FIX::Session::isLogonTime ( const UtcTimeStamp time)
inline

Definition at line 141 of file Session.h.

143  { return m_checkLatency; }

Referenced by fill().

◆ isSessionRegistered()

bool FIX::Session::isSessionRegistered ( const SessionID sessionID)
static

Definition at line 1546 of file Session.cpp.

1548 {
1549  Locker locker( s_mutex );
1550  s_registered.erase( sessionID );

References s_mutex, and s_registered.

Referenced by FIX::ThreadedSocketConnection::setSession().

◆ isSessionTime()

bool FIX::Session::isSessionTime ( const UtcTimeStamp time)
inline

◆ isTargetTooHigh()

bool FIX::Session::isTargetTooHigh ( const MsgSeqNum &  msgSeqNum)
inlineprivate

Definition at line 291 of file Session.h.

◆ isTargetTooLow()

bool FIX::Session::isTargetTooLow ( const MsgSeqNum &  msgSeqNum)
inlineprivate

Definition at line 293 of file Session.h.

◆ logon()

void FIX::Session::logon ( )
inline

◆ logout()

void FIX::Session::logout ( const std::string &  reason = "")
inline

◆ lookupSession() [1/2]

Session * FIX::Session::lookupSession ( const SessionID sessionID)
static

Definition at line 1511 of file Session.cpp.

1513  {
1514  const Header& header = message.getHeader();
1515  const BeginString& beginString = FIELD_GET_REF( header, BeginString );
1516  const SenderCompID& senderCompID = FIELD_GET_REF( header, SenderCompID );
1517  const TargetCompID& targetCompID = FIELD_GET_REF( header, TargetCompID );
1518 
1519  if ( reverse )

References FIELD_GET_REF, FIX::Message::getHeader(), and reverse().

Referenced by FIX::MessageCracker::crack(), FIX::Initiator::getSessionSettings(), FIX::HttpConnection::processDisableSessions(), FIX::HttpConnection::processEnableSessions(), FIX::HttpConnection::processRefreshSession(), FIX::HttpConnection::processRefreshSessions(), FIX::HttpConnection::processResetSession(), FIX::HttpConnection::processResetSessions(), FIX::HttpConnection::processRoot(), FIX::HttpConnection::processSession(), and FIX::Initiator::stop().

◆ lookupSession() [2/2]

Session * FIX::Session::lookupSession ( const std::string &  string,
bool  reverse = false 
)
static

Definition at line 1521 of file Session.cpp.

1528  { return 0; }
1529 }
1530 
1531 bool Session::isSessionRegistered( const SessionID& sessionID )
1532 {
1533  Locker locker( s_mutex );
1534  return s_registered.end() != s_registered.find( sessionID );
1535 }
1536 
1537 Session* Session::registerSession( const SessionID& sessionID )
1538 {
1539  Locker locker( s_mutex );
1540  Session* pSession = lookupSession( sessionID );
1541  if ( pSession == 0 ) return 0;
1542  if ( isSessionRegistered( sessionID ) ) return 0;
1543  s_registered[ sessionID ] = pSession;
1544  return pSession;

◆ newMessage()

Message * FIX::Session::newMessage ( const std::string &  msgType) const
private

Definition at line 507 of file Session.cpp.

507  {
508  const message_order & msgOrder = sessionDD.getMessageOrderedFields(msgType);
509  msg = new Message(hdrOrder, trlOrder, msgOrder);
510  }
511  else
512  {
513  const DataDictionary& applicationDD =
515  const message_order & msgOrder = applicationDD.getMessageOrderedFields(msgType);
516  msg = new Message(hdrOrder, trlOrder, msgOrder);
517  }
518  }
519 
520  return msg;
521 }
522 
523 bool Session::send( Message& message )
524 {
525  message.getHeader().removeField( FIELD::PossDupFlag );
526  message.getHeader().removeField( FIELD::OrigSendingTime );
527  return sendRaw( message );
528 }
529 
530 bool Session::sendRaw( Message& message, int num )
531 {
532  Locker l( m_mutex );
533 
534  try
535  {
536  Header& header = message.getHeader();

◆ next() [1/4]

void FIX::Session::next ( )

Definition at line 140 of file Session.cpp.

140  {
141  if( !m_state.sentLogout() )
142  {
143  m_state.onEvent( "Initiated logout request" );

References generateLogout(), FIX::SessionState::logoutReason(), m_state, FIX::SessionState::onEvent(), and FIX::SessionState::sentLogout().

Referenced by nextQueued(), and FIX::SocketConnection::readMessage().

◆ next() [2/4]

void FIX::Session::next ( const Message message,
const UtcTimeStamp timeStamp,
bool  queued = false 
)

Definition at line 1316 of file Session.cpp.

1320  {
1321  if( m_sessionID.isFIXT() )
1322  {
1323  const DefaultApplVerID& applVerID = FIELD_GET_REF( message, DefaultApplVerID );
1324  setTargetDefaultApplVerID(applVerID);
1325  }
1326  else
1327  {
1329  }
1330  }
1331 
1332  const DataDictionary& sessionDataDictionary =
1334 
1335  if( m_sessionID.isFIXT() && message.isApp() )
1336  {
1337  ApplVerID applVerID = m_targetDefaultApplVerID;
1338  header.getFieldIfSet(applVerID);
1339  const DataDictionary& applicationDataDictionary =
1341  DataDictionary::validate( message, &sessionDataDictionary, &applicationDataDictionary );
1342  }
1343  else
1344  {
1345  sessionDataDictionary.validate( message );
1346  }
1347 
1348  if ( msgType == MsgType_Logon )
1349  nextLogon( message, timeStamp );
1350  else if ( msgType == MsgType_Heartbeat )
1351  nextHeartbeat( message, timeStamp );
1352  else if ( msgType == MsgType_TestRequest )
1353  nextTestRequest( message, timeStamp );
1354  else if ( msgType == MsgType_SequenceReset )
1355  nextSequenceReset( message, timeStamp );
1356  else if ( msgType == MsgType_Logout )
1357  nextLogout( message, timeStamp );
1358  else if ( msgType == MsgType_ResendRequest )
1359  nextResendRequest( message,timeStamp );
1360  else if ( msgType == MsgType_Reject )
1361  nextReject( message, timeStamp );
1362  else
1363  {
1364  if ( !verify( message ) ) return ;
1366  }
1367  }
1368  catch ( MessageParseError& e )
1369  { m_state.onEvent( e.what() ); }
1370  catch ( RequiredTagMissing & e )
1371  { LOGEX( generateReject( message, SessionRejectReason_REQUIRED_TAG_MISSING, e.field ) ); }
1372  catch ( FieldNotFound & e )
1373  {
1374  if( header.getField(FIELD::BeginString) >= FIX::BeginString_FIX42 && message.isApp() )
1375  {
1376  LOGEX( generateBusinessReject( message, BusinessRejectReason_CONDITIONALLY_REQUIRED_FIELD_MISSING, e.field ) );
1377  }
1378  else
1379  {
1380  LOGEX( generateReject( message, SessionRejectReason_REQUIRED_TAG_MISSING, e.field ) );
1381  if ( header.getField(FIELD::MsgType) == MsgType_Logon )
1382  {
1383  m_state.onEvent( "Required field missing from logon" );
1384  disconnect();
1385  }
1386  }
1387  }
1388  catch ( InvalidTagNumber & e )
1389  { LOGEX( generateReject( message, SessionRejectReason_INVALID_TAG_NUMBER, e.field ) ); }
1390  catch ( NoTagValue & e )
1391  { LOGEX( generateReject( message, SessionRejectReason_TAG_SPECIFIED_WITHOUT_A_VALUE, e.field ) ); }
1392  catch ( TagNotDefinedForMessage & e )
1393  { LOGEX( generateReject( message, SessionRejectReason_TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE, e.field ) ); }
1394  catch ( InvalidMessageType& )
1395  { LOGEX( generateReject( message, SessionRejectReason_INVALID_MSGTYPE ) ); }
1396  catch ( UnsupportedMessageType& )
1397  {
1398  if ( header.getField(FIELD::BeginString) >= FIX::BeginString_FIX42 )
1399  { LOGEX( generateBusinessReject( message, BusinessRejectReason_UNKNOWN_MESSAGE_TYPE ) ); }
1400  else
1401  { LOGEX( generateReject( message, "Unsupported message type" ) ); }
1402  }
1403  catch ( TagOutOfOrder & e )
1404  { LOGEX( generateReject( message, SessionRejectReason_TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER, e.field ) ); }
1405  catch ( IncorrectDataFormat & e )
1406  { LOGEX( generateReject( message, SessionRejectReason_INCORRECT_DATA_FORMAT_FOR_VALUE, e.field ) ); }
1407  catch ( IncorrectTagValue & e )
1408  { LOGEX( generateReject( message, SessionRejectReason_VALUE_IS_INCORRECT, e.field ) ); }
1409  catch ( RepeatedTag & e )
1410  { LOGEX( generateReject( message, SessionRejectReason_TAG_APPEARS_MORE_THAN_ONCE, e.field ) ); }
1411  catch ( RepeatingGroupCountMismatch & e )
1412  { LOGEX( generateReject( message, SessionRejectReason_INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP, e.field ) ); }
1413  catch ( InvalidMessage& e )
1414  { m_state.onEvent( e.what() ); }
1415  catch ( RejectLogon& e )
1416  {
1417  m_state.onEvent( e.what() );
1418  generateLogout( e.what() );
1419  disconnect();
1420  }
1421  catch ( UnsupportedVersion& )
1422  {
1423  if ( header.getField(FIELD::MsgType) == MsgType_Logout )
1424  nextLogout( message, timeStamp );
1425  else
1426  {
1427  generateLogout( "Incorrect BeginString" );
1429  }
1430  }
1431  catch ( IOException& e )
1432  {
1433  m_state.onEvent( e.what() );
1434  disconnect();
1435  }
1436 
1437  if( !queued )
1438  nextQueued( timeStamp );
1439 
1440  if( isLoggedOn() )
1441  next();
1442 }
1443 
1444 bool Session::sendToTarget( Message& message, const std::string& qualifier )
1445 throw( SessionNotFound )
1446 {
1447  try
1448  {
1449  SessionID sessionID = message.getSessionID( qualifier );
1450  return sendToTarget( message, sessionID );
1451  }
1452  catch ( FieldNotFound& ) { throw SessionNotFound(); }
1453 }
1454 
1455 bool Session::sendToTarget( Message& message, const SessionID& sessionID )
1456 throw( SessionNotFound )
1457 {

References FIELD_GET_REF, FIX::SessionID::isFIXT(), m_sessionID, setTargetDefaultApplVerID(), and FIX::Message::toApplVerID().

◆ next() [3/4]

void FIX::Session::next ( const std::string &  msg,
const UtcTimeStamp timeStamp,
bool  queued = false 
)

Definition at line 1282 of file Session.cpp.

1286  {
1287  m_state.onEvent( e.what() );
1288 
1289  try
1290  {
1291  if( identifyType(msg) == MsgType_Logon )
1292  {
1293  m_state.onEvent( "Logon message is not valid" );
1294  disconnect();
1295  }
1296  } catch( MessageParseError& ) {}
1297  throw e;
1298  }
1299 }
1300 
1301 void Session::next( const Message& message, const UtcTimeStamp& timeStamp, bool queued )
1302 {
1303  const Header& header = message.getHeader();
1304 
1305  try
1306  {
1307  if ( !checkSessionTime(timeStamp) )
1308  { reset(); return; }
1309 
1310  const MsgType& msgType = FIELD_GET_REF( header, MsgType );
1311  const BeginString& beginString = FIELD_GET_REF( header, BeginString );
1312  // make sure these fields are present
1313  FIELD_THROW_IF_NOT_FOUND( header, SenderCompID );
1314  FIELD_THROW_IF_NOT_FOUND( header, TargetCompID );

◆ next() [4/4]

void FIX::Session::next ( const UtcTimeStamp timeStamp)

Definition at line 145 of file Session.cpp.

152  {
153  if ( m_state.shouldSendLogon() && isLogonTime(timeStamp) )
154  {
155  generateLogon();
156  m_state.onEvent( "Initiated logon request" );
157  }
158  else if ( m_state.alreadySentLogon() && m_state.logonTimedOut() )
159  {
160  m_state.onEvent( "Timed out waiting for logon response" );
161  disconnect();
162  }
163  return ;
164  }
165 
166  if ( m_state.heartBtInt() == 0 ) return ;
167 
168  if ( m_state.logoutTimedOut() )
169  {
170  m_state.onEvent( "Timed out waiting for logout response" );
171  disconnect();
172  }
173 
174  if ( m_state.withinHeartBeat() ) return ;
175 
176  if ( m_state.timedOut() )
177  {
178  m_state.onEvent( "Timed out waiting for heartbeat" );
179  disconnect();
180  }
181  else
182  {
183  if ( m_state.needTestRequest() )
184  {
185  generateTestRequest( "TEST" );
187  m_state.onEvent( "Sent test request TEST" );
188  }
189  else if ( m_state.needHeartbeat() )
190  {
192  }
193  }
194  }
195  catch ( FIX::IOException& e )
196  {
197  m_state.onEvent( e.what() );
198  disconnect();
199  }
200 }
201 
202 void Session::nextLogon( const Message& logon, const UtcTimeStamp& timeStamp )
203 {
204  SenderCompID senderCompID;
205  TargetCompID targetCompID;
206  logon.getHeader().getField( senderCompID );
207  logon.getHeader().getField( targetCompID );
208 
209  if( m_refreshOnLogon )
210  refresh();
211 
212  if( !isEnabled() )
213  {
214  m_state.onEvent( "Session is not enabled for logon" );
215  disconnect();

◆ nextHeartbeat()

void FIX::Session::nextHeartbeat ( const Message heartbeat,
const UtcTimeStamp timeStamp 
)
private

Definition at line 295 of file Session.cpp.

296 {
297  if ( !verify( logout, false, false ) ) return ;
298  if ( !m_state.sentLogout() )
299  {
300  m_state.onEvent( "Received logout request" );

References generateLogout(), logout(), m_state, FIX::SessionState::onEvent(), FIX::SessionState::sentLogout(), and verify().

◆ nextLogon()

void FIX::Session::nextLogon ( const Message logon,
const UtcTimeStamp timeStamp 
)
private

Definition at line 217 of file Session.cpp.

220  {
221  m_state.onEvent( "Received logon outside of valid logon time" );
222  disconnect();
223  return;
224  }
225 
226  ResetSeqNumFlag resetSeqNumFlag(false);
227  logon.getFieldIfSet(resetSeqNumFlag);
228  m_state.receivedReset( resetSeqNumFlag );
229 
230  if( m_state.receivedReset() )
231  {
232  m_state.onEvent( "Logon contains ResetSeqNumFlag=Y, reseting sequence numbers to 1" );
233  if( !m_state.sentReset() ) m_state.reset();
234  }
235 
237  {
238  m_state.onEvent( "Received logon response before sending request" );
239  disconnect();
240  return;
241  }
242 
243  if( !m_state.initiate() && m_resetOnLogon )
244  m_state.reset();
245 
246  if( !verify( logon, false, true ) )
247  return;
248  m_state.receivedLogon( true );
249 
250  if ( !m_state.initiate()
251  || (m_state.receivedReset() && !m_state.sentReset()) )
252  {
253  logon.getFieldIfSet(m_state.heartBtInt());
254  m_state.onEvent( "Received logon request" );
255  generateLogon( logon );
256  m_state.onEvent( "Responding to logon request" );
257  }
258  else
259  m_state.onEvent( "Received logon response" );
260 
261  m_state.sentReset( false );
262  m_state.receivedReset( false );
263 
264  MsgSeqNum msgSeqNum;
265  logon.getHeader().getField( msgSeqNum );
266  if ( isTargetTooHigh( msgSeqNum ) && !resetSeqNumFlag )
267  {
269  }
270  else
271  {
273  nextQueued( timeStamp );
274  }
275 
276  if ( isLoggedOn() )
278 }
279 
280 void Session::nextHeartbeat( const Message& heartbeat, const UtcTimeStamp& timeStamp )
281 {
282  if ( !verify( heartbeat ) ) return ;
284  nextQueued( timeStamp );
285 }
286 
287 void Session::nextTestRequest( const Message& testRequest, const UtcTimeStamp& timeStamp )
288 {
289  if ( !verify( testRequest ) ) return ;
290  generateHeartbeat( testRequest );
292  nextQueued( timeStamp );
293 }

◆ nextLogout()

void FIX::Session::nextLogout ( const Message logout,
const UtcTimeStamp timeStamp 
)
private

Definition at line 310 of file Session.cpp.

313 {
314  if ( !verify( reject, false, true ) ) return ;
316  nextQueued( timeStamp );
317 }
318 
319 void Session::nextSequenceReset( const Message& sequenceReset, const UtcTimeStamp& timeStamp )
320 {
321  bool isGapFill = false;
322  GapFillFlag gapFillFlag;
323  if ( sequenceReset.getFieldIfSet( gapFillFlag ) )
324  {
325  isGapFill = gapFillFlag;

◆ nextQueued() [1/2]

void FIX::Session::nextQueued ( const UtcTimeStamp timeStamp)
private

Definition at line 1253 of file Session.cpp.

1255  {

References FIX::SessionState::incrNextTargetMsgSeqNum(), and m_state.

◆ nextQueued() [2/2]

bool FIX::Session::nextQueued ( int  num,
const UtcTimeStamp timeStamp 
)
private

Definition at line 1258 of file Session.cpp.

1259  {
1260  next( msg, timeStamp, true );
1261  }
1262  return true;
1263  }
1264  return false;
1265 }
1266 
1267 void Session::next( const std::string& msg, const UtcTimeStamp& timeStamp, bool queued )
1268 {
1269  try
1270  {
1271  m_state.onIncoming( msg );
1272  const DataDictionary& sessionDD =
1274  if( m_sessionID.isFIXT() )
1275  {
1276  const DataDictionary& applicationDD =
1278  next( Message( msg, sessionDD, applicationDD, m_validateLengthAndChecksum ), timeStamp, queued );
1279  }
1280  else

References next().

◆ nextReject()

void FIX::Session::nextReject ( const Message reject,
const UtcTimeStamp timeStamp 
)
private

Definition at line 327 of file Session.cpp.

332  {

References m_state, and FIX::SessionState::onEvent().

◆ nextResendRequest()

void FIX::Session::nextResendRequest ( const Message resendRequest,
const UtcTimeStamp timeStamp 
)
private

Definition at line 359 of file Session.cpp.

363  { endSeqNo = getExpectedSenderNum() - 1; }
364 
365  if ( !m_persistMessages )
366  {
367  endSeqNo = EndSeqNo(endSeqNo + 1);
369  if( endSeqNo > next )
370  endSeqNo = EndSeqNo(next);
371  generateSequenceReset( beginSeqNo, endSeqNo );
372  return;
373  }
374 
375  std::vector < std::string > messages;
376  m_state.get( beginSeqNo, endSeqNo, messages );
377 
378  std::vector < std::string > ::iterator i;
379  MsgSeqNum msgSeqNum(0);
380  MsgType msgType;
381  int begin = 0;
382  int current = beginSeqNo;
383  std::string messageString;
384 
385  for ( i = messages.begin(); i != messages.end(); ++i )
386  {
387  SmartPtr<FIX::Message> pMsg;
388  std::string strMsgType;
389  const DataDictionary& sessionDD =
391  if (sessionDD.isMessageFieldsOrderPreserved())
392  {
393  std::string::size_type equalSign = (*i).find("\00135=");
394  equalSign += 4;
395  std::string::size_type soh = (*i).find_first_of('\001', equalSign);
396  strMsgType = (*i).substr(equalSign, soh - equalSign);
397 #ifdef HAVE_EMX
398  if (FIX::Message::isAdminMsgType(strMsgType) == false)
399  {
400  equalSign = (*i).find("\0019426=", soh);
401  if (equalSign == std::string::npos)
402  throw FIX::IOException("EMX message type (9426) not found");
403 
404  equalSign += 6;
405  soh = (*i).find_first_of('\001', equalSign);
406  if (soh == std::string::npos)
407  throw FIX::IOException("EMX message type (9426) soh char not found");
408  strMsgType.assign((*i).substr(equalSign, soh - equalSign));
409  }
410 #endif
411  }
412 
413  if( m_sessionID.isFIXT() )
414  {
415  Message msg;
416  msg.setStringHeader(*i);
417  ApplVerID applVerID;
418  if( !msg.getHeader().getFieldIfSet(applVerID) )
419  applVerID = m_senderDefaultApplVerID;
420 
421  const DataDictionary& applicationDD =
423  if (strMsgType.empty())
424  pMsg.reset( new Message( *i, sessionDD, applicationDD, m_validateLengthAndChecksum ));
425  else
426  {
427  const message_order & hdrOrder = sessionDD.getHeaderOrderedFields();
428  const message_order & trlOrder = sessionDD.getTrailerOrderedFields();
429  const message_order & msgOrder = applicationDD.getMessageOrderedFields(strMsgType);
430  pMsg.reset( new Message( hdrOrder, trlOrder, msgOrder, *i, sessionDD, applicationDD, m_validateLengthAndChecksum ));
431  }
432  }
433  else
434  {
435  if (strMsgType.empty())
436  pMsg.reset( new Message( *i, sessionDD, m_validateLengthAndChecksum ));
437  else
438  {
439  const message_order & hdrOrder = sessionDD.getHeaderOrderedFields();
440  const message_order & trlOrder = sessionDD.getTrailerOrderedFields();
441  const message_order & msgOrder = sessionDD.getMessageOrderedFields(strMsgType);
442  pMsg.reset(new Message(hdrOrder, trlOrder, msgOrder, *i, sessionDD, m_validateLengthAndChecksum ));
443  }
444  }
445 
446  Message & msg = *pMsg;
447 
448  msg.getHeader().getField( msgSeqNum );
449  msg.getHeader().getField( msgType );
450 
451  if( (current != msgSeqNum) && !begin )
452  begin = current;
453 
454  if ( Message::isAdminMsgType( msgType ) )
455  {
456  if ( !begin ) begin = msgSeqNum;
457  }
458  else
459  {
460  if ( resend( msg ) )
461  {
462  if ( begin ) generateSequenceReset( begin, msgSeqNum );
463  send( msg.toString(messageString) );
464  m_state.onEvent( "Resending Message: "
465  + IntConvertor::convert( msgSeqNum ) );
466  begin = 0;
467  }
468  else
469  { if ( !begin ) begin = msgSeqNum; }
470  }
471  current = msgSeqNum + 1;
472  }
473  if ( begin )
474  {
475  generateSequenceReset( begin, msgSeqNum + 1 );
476  }
477 
478  if ( endSeqNo > msgSeqNum )
479  {
480  endSeqNo = EndSeqNo(endSeqNo + 1);
482  if( endSeqNo > next )
483  endSeqNo = EndSeqNo(next);
484  generateSequenceReset( beginSeqNo, endSeqNo );
485  }
486 
487  resendRequest.getHeader().getField( msgSeqNum );
488  if( !isTargetTooHigh(msgSeqNum) && !isTargetTooLow(msgSeqNum) )
490 }
491 
492 Message * Session::newMessage(const std::string & msgType) const
493 {
494  Message * msg = 0;
495 
496  const DataDictionary& sessionDD =
498  if (!sessionDD.isMessageFieldsOrderPreserved())
499  {
500  msg = new Message();
501  }
502  else
503  {
504  const message_order & hdrOrder = sessionDD.getHeaderOrderedFields();
505  const message_order & trlOrder = sessionDD.getTrailerOrderedFields();

References getExpectedSenderNum().

◆ nextSequenceReset()

void FIX::Session::nextSequenceReset ( const Message sequenceReset,
const UtcTimeStamp timeStamp 
)
private

Definition at line 334 of file Session.cpp.

335  : " + IntConvertor::convert( newSeqNo ) );
336 
337  if ( newSeqNo > getExpectedTargetNum() )
338  m_state.setNextTargetMsgSeqNum( MsgSeqNum( newSeqNo ) );
339  else if ( newSeqNo < getExpectedTargetNum() )
340  generateReject( sequenceReset, SessionRejectReason_VALUE_IS_INCORRECT );
341  }
342 }
343 
344 void Session::nextResendRequest( const Message& resendRequest, const UtcTimeStamp& timeStamp )
345 {
346  if ( !verify( resendRequest, false, false ) ) return ;
347 
348  Locker l( m_mutex );
349 
350  BeginSeqNo beginSeqNo;
351  EndSeqNo endSeqNo;
352  resendRequest.getField( beginSeqNo );
353  resendRequest.getField( endSeqNo );
354 
355  m_state.onEvent( "Received ResendRequest FROM: "
356  + IntConvertor::convert( beginSeqNo ) +
357  " TO: " + IntConvertor::convert( endSeqNo ) );

◆ nextTestRequest()

void FIX::Session::nextTestRequest ( const Message testRequest,
const UtcTimeStamp timeStamp 
)
private

Definition at line 302 of file Session.cpp.

◆ numSessions()

size_t FIX::Session::numSessions ( )
static

Definition at line 1568 of file Session.cpp.

Referenced by FIX::HttpConnection::processRoot().

◆ persist()

void FIX::Session::persist ( const Message message,
const std::string &  messageString 
)
throw (IOException
)
private

Definition at line 678 of file Session.cpp.

Referenced by sendRaw().

◆ populateRejectReason() [1/2]

void FIX::Session::populateRejectReason ( Message reject,
const std::string &  text 
)
private

Definition at line 1044 of file Session.cpp.

◆ populateRejectReason() [2/2]

void FIX::Session::populateRejectReason ( Message reject,
int  field,
const std::string &  text 
)
private

Definition at line 1024 of file Session.cpp.

1030 {
1031  reject.setField( Text( text ) );
1032 }
1033 
1034 bool Session::verify( const Message& msg, bool checkTooHigh,
1035  bool checkTooLow )
1036 {
1037  const MsgType* pMsgType = 0;
1038  const MsgSeqNum* pMsgSeqNum = 0;
1039 
1040  try
1041  {
1042  const Header& header = msg.getHeader();

◆ receivedLogon()

bool FIX::Session::receivedLogon ( )
inline

Definition at line 95 of file Session.h.

◆ refresh()

void FIX::Session::refresh ( )
throw (IOException
)
inline

◆ registerSession()

Session * FIX::Session::registerSession ( const SessionID sessionID)
static

Definition at line 1552 of file Session.cpp.

1554 {
1555  Locker locker( s_mutex );
1556  return s_sessions.size();
1557 }
1558 
1559 bool Session::addSession( Session& s )
1560 {

References s_mutex, and s_sessions.

Referenced by FIX::ThreadedSocketConnection::setSession().

◆ removeSession()

void FIX::Session::removeSession ( Session s)
staticprivate

Definition at line 1588 of file Session.cpp.

◆ resend()

bool FIX::Session::resend ( Message message)
private

Definition at line 658 of file Session.cpp.

660  { return false; }
661 }
662 
663 void Session::persist( const Message& message, const std::string& messageString )
664 throw ( IOException )
665 {
666  MsgSeqNum msgSeqNum;
667  message.getHeader().getField( msgSeqNum );
668  if( m_persistMessages )
669  m_state.set( msgSeqNum, messageString );
671 }
672 
674 {
675  SmartPtr<Message> pMsg(newMessage("A"));
676  Message & logon = *pMsg;

◆ reset()

void FIX::Session::reset ( )
throw (IOException
)
inline

◆ send() [1/2]

bool FIX::Session::send ( const std::string &  string)
private

Definition at line 621 of file Session.cpp.

626  {

◆ send() [2/2]

bool FIX::Session::send ( Message message)

Definition at line 538 of file Session.cpp.

Referenced by sendRaw().

◆ sendRaw()

bool FIX::Session::sendRaw ( Message message,
int  msgSeqNum = 0 
)
private

Definition at line 545 of file Session.cpp.

548  {
549  m_application.toAdmin( message, m_sessionID );
550 
551  if( msgType == "A" && !m_state.receivedReset() )
552  {
553  ResetSeqNumFlag resetSeqNumFlag( false );
554  message.getFieldIfSet(resetSeqNumFlag);
555 
556  if( resetSeqNumFlag )
557  {
558  m_state.reset();
559  message.getHeader().setField( MsgSeqNum(getExpectedSenderNum()) );
560  }
561  m_state.sentReset( resetSeqNumFlag );
562  }
563 
564  message.toString( messageString );
565 
566  if( !num )
567  persist( message, messageString );
568 
569  if (
570  msgType == "A" || msgType == "5"
571  || msgType == "2" || msgType == "4"
572  || isLoggedOn() )
573  {
574  send( messageString );
575  }
576  }
577  else
578  {
579  // do not send application messages if they will just be cleared
580  if( !isLoggedOn() && shouldSendReset() )
581  return false;
582 
583  try
584  {
585  m_application.toApp( message, m_sessionID );
586  message.toString( messageString );
587 
588  if( !num )
589  persist( message, messageString );
590 
591  if ( isLoggedOn() )
592  send( messageString );
593  }
594  catch ( DoNotSend& ) { return false; }
595  }
596 
597  return true;
598  }
599  catch ( IOException& e )
600  {
601  m_state.onEvent( e.what() );
602  return false;
603  }
604 }
605 
606 bool Session::send( const std::string& string )
607 {
608  if ( !m_pResponder ) return false;
609  m_state.onOutgoing( string );
610  return m_pResponder->send( string );
611 }
612 
613 void Session::disconnect()
614 {
615  Locker l(m_mutex);
616 
617  if ( m_pResponder )
618  {
619  m_state.onEvent( "Disconnecting" );

References getExpectedSenderNum(), isLoggedOn(), m_application, m_sessionID, m_state, persist(), FIX::SessionState::receivedReset(), FIX::SessionState::reset(), send(), FIX::SessionState::sentReset(), and FIX::Application::toAdmin().

◆ sendToTarget() [1/4]

bool FIX::Session::sendToTarget ( Message message,
const SenderCompID &  senderCompID,
const TargetCompID &  targetCompID,
const std::string &  qualifier = "" 
)
throw (SessionNotFound
)
static

Definition at line 1480 of file Session.cpp.

1480 {
1481  return sendToTarget( message, SenderCompID( sender ),
1482  TargetCompID( target ), qualifier );
1483 }
1484 
1485 std::set<SessionID> Session::getSessions()
1486 {
1487  return s_sessionIDs;
1488 }
1489 

◆ sendToTarget() [2/4]

bool FIX::Session::sendToTarget ( Message message,
const SessionID sessionID 
)
throw (SessionNotFound
)
static

Definition at line 1470 of file Session.cpp.

1470 {
1471  message.getHeader().setField( senderCompID );
1472  message.getHeader().setField( targetCompID );
1473  return sendToTarget( message, qualifier );
1474 }
1475 
1477 ( Message& message, const std::string& sender, const std::string& target,

◆ sendToTarget() [3/4]

bool FIX::Session::sendToTarget ( Message message,
const std::string &  qualifier = "" 
)
throw (SessionNotFound
)
static

Definition at line 1459 of file Session.cpp.

1470 {

◆ sendToTarget() [4/4]

bool FIX::Session::sendToTarget ( Message message,
const std::string &  senderCompID,
const std::string &  targetCompID,
const std::string &  qualifier = "" 
)
throw (SessionNotFound
)
static

Definition at line 1492 of file Session.cpp.

1497 {
1498  Locker locker( s_mutex );

◆ sentLogon()

bool FIX::Session::sentLogon ( )
inline

Definition at line 93 of file Session.h.

◆ sentLogout()

bool FIX::Session::sentLogout ( )
inline

Definition at line 94 of file Session.h.

◆ set()

bool FIX::Session::set ( int  s,
const Message m 
)
private

◆ setCheckCompId()

void FIX::Session::setCheckCompId ( bool  value)
inline

Definition at line 170 of file Session.h.

170  { m_resetOnLogout = value; }
171 

References m_resetOnLogout.

Referenced by FIX::HttpConnection::processSession().

◆ setCheckLatency()

void FIX::Session::setCheckLatency ( bool  value)
inline

Definition at line 175 of file Session.h.

175  { m_resetOnDisconnect = value; }
176 

References m_resetOnDisconnect.

Referenced by FIX::HttpConnection::processSession().

◆ setDataDictionaryProvider()

void FIX::Session::setDataDictionaryProvider ( const DataDictionaryProvider dataDictionaryProvider)
inline

Definition at line 108 of file Session.h.

109  { return m_sessionTime.isInRange(time); }

References FIX::TimeRange::isInRange(), and m_sessionTime.

◆ setLogonTime()

void FIX::Session::setLogonTime ( const TimeRange value)
inline

Definition at line 150 of file Session.h.

150  { m_maxLatency = value; }
151 

References m_maxLatency.

◆ setLogonTimeout()

void FIX::Session::setLogonTimeout ( int  value)
inline

Definition at line 185 of file Session.h.

185  { if (value)

References m_timestampPrecision.

Referenced by FIX::HttpConnection::processSession().

◆ setLogoutTimeout()

void FIX::Session::setLogoutTimeout ( int  value)
inline

Definition at line 190 of file Session.h.

191  { return m_timestampPrecision; }

References m_timestampPrecision.

Referenced by FIX::HttpConnection::processSession().

◆ setMaxLatency()

void FIX::Session::setMaxLatency ( int  value)
inline

Definition at line 180 of file Session.h.

180  { m_refreshOnLogon = value; }
181 

References m_refreshOnLogon.

Referenced by FIX::HttpConnection::processSession().

◆ setMillisecondsInTimeStamp()

void FIX::Session::setMillisecondsInTimeStamp ( bool  value)
inline

Definition at line 215 of file Session.h.

224  { return m_state.getNextSenderMsgSeqNum(); }

Referenced by FIX::HttpConnection::processSession().

◆ setNextSenderMsgSeqNum()

void FIX::Session::setNextSenderMsgSeqNum ( int  num)
throw (IOException
)
inline

Definition at line 101 of file Session.h.

109  { return m_sessionTime.isInRange(time); }

Referenced by FIX::HttpConnection::processSession().

◆ setNextTargetMsgSeqNum()

void FIX::Session::setNextTargetMsgSeqNum ( int  num)
throw (IOException
)
inline

Definition at line 103 of file Session.h.

109  { return m_sessionTime.isInRange(time); }

Referenced by FIX::HttpConnection::processSession().

◆ setPersistMessages()

void FIX::Session::setPersistMessages ( bool  value)
inline

Definition at line 233 of file Session.h.

Referenced by FIX::HttpConnection::processSession().

◆ setRefreshOnLogon()

void FIX::Session::setRefreshOnLogon ( bool  value)
inline

Definition at line 210 of file Session.h.

211  {

References checkSessionTime(), and FIX::TYPE::UtcTimeStamp.

Referenced by FIX::HttpConnection::processSession().

◆ setResetOnDisconnect()

void FIX::Session::setResetOnDisconnect ( bool  value)
inline

Definition at line 205 of file Session.h.

206  { return m_validateLengthAndChecksum; }

References m_validateLengthAndChecksum.

Referenced by FIX::HttpConnection::processSession().

◆ setResetOnLogon()

void FIX::Session::setResetOnLogon ( bool  value)
inline

Definition at line 195 of file Session.h.

201  { return m_persistMessages; }

Referenced by FIX::HttpConnection::processSession().

◆ setResetOnLogout()

void FIX::Session::setResetOnLogout ( bool  value)
inline

Definition at line 200 of file Session.h.

201  { return m_persistMessages; }

References m_persistMessages.

Referenced by FIX::HttpConnection::processSession().

◆ setResponder()

void FIX::Session::setResponder ( Responder pR)
inline

Definition at line 241 of file Session.h.

250  {

◆ setSenderDefaultApplVerID()

void FIX::Session::setSenderDefaultApplVerID ( const std::string &  senderDefaultApplVerID)
inline

Definition at line 155 of file Session.h.

155  { m_state.logonTimeout( value ); }
156 

References FIX::SessionState::logonTimeout(), and m_state.

◆ setSendRedundantResendRequests()

void FIX::Session::setSendRedundantResendRequests ( bool  value)
inline

Definition at line 165 of file Session.h.

165  { m_resetOnLogon = value; }
166 

References m_resetOnLogon.

Referenced by FIX::HttpConnection::processSession().

◆ setTargetDefaultApplVerID()

void FIX::Session::setTargetDefaultApplVerID ( const std::string &  targetDefaultApplVerID)
inline

Definition at line 160 of file Session.h.

160  { m_state.logoutTimeout( value ); }
161 

References FIX::SessionState::logoutTimeout(), and m_state.

Referenced by next().

◆ setTimestampPrecision()

void FIX::Session::setTimestampPrecision ( int  precision)
inline

Definition at line 223 of file Session.h.

224  { return m_state.getNextSenderMsgSeqNum(); }
226 
227  Log* getLog() { return &m_state; }
228  const MessageStore* getStore() { return &m_state; }
229 

References FIX::SessionState::getNextSenderMsgSeqNum(), and m_state.

◆ setValidateLengthAndChecksum()

void FIX::Session::setValidateLengthAndChecksum ( bool  value)
inline

Definition at line 238 of file Session.h.

◆ shouldSendReset()

bool FIX::Session::shouldSendReset ( )
private

Definition at line 1121 of file Session.cpp.

◆ unregisterSession()

void FIX::Session::unregisterSession ( const SessionID sessionID)
static

Definition at line 1562 of file Session.cpp.

1564  {
1565  s_sessions[ s.m_sessionID ] = &s;
1566  s_sessionIDs.insert( s.m_sessionID );

References m_sessionID, s_sessionIDs, and s_sessions.

Referenced by FIX::ThreadedSocketConnection::ThreadedSocketConnection().

◆ validLogonState()

bool FIX::Session::validLogonState ( const MsgType &  msgType)
private

Definition at line 1132 of file Session.cpp.

1139 {
1140  if ( Message::isAdminMsgType( msgType ) )
1142  else
1144 }
1145 
1146 void Session::doBadTime( const Message& msg )
1147 {
1148  generateReject( msg, SessionRejectReason_SENDINGTIME_ACCURACY_PROBLEM );
1149  generateLogout();
1150 }

◆ verify()

bool FIX::Session::verify ( const Message msg,
bool  checkTooHigh = true,
bool  checkTooLow = true 
)
private

Definition at line 1049 of file Session.cpp.

1056  {
1057  doBadTime( msg );
1058  return false;
1059  }
1060  if ( !isCorrectCompID( senderCompID, targetCompID ) )
1061  {
1062  doBadCompID( msg );
1063  return false;
1064  }
1065 
1066  if ( checkTooHigh && isTargetTooHigh( *pMsgSeqNum ) )
1067  {
1068  doTargetTooHigh( msg );
1069  return false;
1070  }
1071  else if ( checkTooLow && isTargetTooLow( *pMsgSeqNum ) )
1072  {
1073  doTargetTooLow( msg );
1074  return false;
1075  }
1076 
1077  if ( (checkTooHigh || checkTooLow) && m_state.resendRequested() )
1078  {
1080 
1081  if ( *pMsgSeqNum >= range.second )
1082  {
1083  m_state.onEvent ("ResendRequest for messages FROM: " +
1084  IntConvertor::convert (range.first) + " TO: " +
1085  IntConvertor::convert (range.second) +
1086  " has been satisfied.");
1087  m_state.resendRange (0, 0);
1088  }
1089  }
1090  }
1091  catch ( std::exception& e )
1092  {
1093  m_state.onEvent( e.what() );
1094  disconnect();
1095  return false;
1096  }
1097 
1098  UtcTimeStamp now;
1099  m_state.lastReceivedTime( now );
1100  m_state.testRequest( 0 );
1101 
1102  fromCallback( pMsgType ? *pMsgType : MsgType(), msg, m_sessionID );
1103  return true;
1104 }
1105 
1107 {
1108  std::string beginString = m_sessionID.getBeginString();
1109  return beginString >= FIX::BeginString_FIX41
1110  && ( m_resetOnLogon ||
1111  m_resetOnLogout ||
1113  && ( getExpectedSenderNum() == 1 )
1114  && ( getExpectedTargetNum() == 1 );
1115 }
1116 
1117 bool Session::validLogonState( const MsgType& msgType )
1118 {
1119  if ( (msgType == MsgType_Logon && m_state.sentReset())

Referenced by nextHeartbeat().

Member Data Documentation

◆ m_application

Application& FIX::Session::m_application
private

Definition at line 349 of file Session.h.

Referenced by sendRaw().

◆ m_checkCompId

bool FIX::Session::m_checkCompId
private

Definition at line 357 of file Session.h.

Referenced by isSessionTime().

◆ m_checkLatency

bool FIX::Session::m_checkLatency
private

Definition at line 358 of file Session.h.

Referenced by isAcceptor(), and isInitiator().

◆ m_dataDictionaryProvider

DataDictionaryProvider FIX::Session::m_dataDictionaryProvider
private

Definition at line 369 of file Session.h.

◆ m_logonTime

TimeRange FIX::Session::m_logonTime
private

Definition at line 352 of file Session.h.

Referenced by getDataDictionaryProvider().

◆ m_maxLatency

int FIX::Session::m_maxLatency
private

Definition at line 359 of file Session.h.

Referenced by getLogonTime(), and setLogonTime().

◆ m_messageStoreFactory

MessageStoreFactory& FIX::Session::m_messageStoreFactory
private

Definition at line 370 of file Session.h.

◆ m_mutex

Mutex FIX::Session::m_mutex
private

Definition at line 373 of file Session.h.

◆ m_persistMessages

bool FIX::Session::m_persistMessages
private

Definition at line 365 of file Session.h.

Referenced by getResetOnDisconnect(), and setResetOnLogout().

◆ m_pLogFactory

LogFactory* FIX::Session::m_pLogFactory
private

Definition at line 371 of file Session.h.

◆ m_pResponder

Responder* FIX::Session::m_pResponder
private

Definition at line 372 of file Session.h.

◆ m_refreshOnLogon

bool FIX::Session::m_refreshOnLogon
private

Definition at line 363 of file Session.h.

Referenced by getMaxLatency(), and setMaxLatency().

◆ m_resetOnDisconnect

bool FIX::Session::m_resetOnDisconnect
private

Definition at line 362 of file Session.h.

Referenced by getCheckLatency(), and setCheckLatency().

◆ m_resetOnLogon

bool FIX::Session::m_resetOnLogon
private

Definition at line 360 of file Session.h.

Referenced by getSendRedundantResendRequests(), and setSendRedundantResendRequests().

◆ m_resetOnLogout

bool FIX::Session::m_resetOnLogout
private

Definition at line 361 of file Session.h.

Referenced by getCheckCompId(), and setCheckCompId().

◆ m_senderDefaultApplVerID

std::string FIX::Session::m_senderDefaultApplVerID
private

Definition at line 354 of file Session.h.

◆ m_sendRedundantResendRequests

bool FIX::Session::m_sendRedundantResendRequests
private

Definition at line 356 of file Session.h.

Referenced by doTargetTooHigh().

◆ m_sessionID

SessionID FIX::Session::m_sessionID
private

Definition at line 350 of file Session.h.

Referenced by generateLogout(), next(), sendRaw(), and unregisterSession().

◆ m_sessionTime

TimeRange FIX::Session::m_sessionTime
private

Definition at line 351 of file Session.h.

Referenced by setDataDictionaryProvider().

◆ m_state

SessionState FIX::Session::m_state
private

◆ m_targetDefaultApplVerID

std::string FIX::Session::m_targetDefaultApplVerID
private

Definition at line 355 of file Session.h.

◆ m_timestampPrecision

int FIX::Session::m_timestampPrecision
private

Definition at line 364 of file Session.h.

Referenced by getLogonTimeout(), setLogonTimeout(), and setLogoutTimeout().

◆ m_validateLengthAndChecksum

bool FIX::Session::m_validateLengthAndChecksum
private

Definition at line 366 of file Session.h.

Referenced by getRefreshOnLogon(), and setResetOnDisconnect().

◆ s_mutex

Mutex FIX::Session::s_mutex
staticprivate

Definition at line 378 of file Session.h.

Referenced by addSession(), isSessionRegistered(), and registerSession().

◆ s_registered

Session::Sessions FIX::Session::s_registered
staticprivate

Definition at line 377 of file Session.h.

Referenced by addSession(), and isSessionRegistered().

◆ s_sessionIDs

Session::SessionIDs FIX::Session::s_sessionIDs
staticprivate

Definition at line 376 of file Session.h.

Referenced by addSession(), and unregisterSession().

◆ s_sessions

Session::Sessions FIX::Session::s_sessions
staticprivate

Definition at line 375 of file Session.h.

Referenced by addSession(), registerSession(), and unregisterSession().


The documentation for this class was generated from the following files:
FIX::Session::m_checkCompId
bool m_checkCompId
Definition: Session.h:357
FIX::SessionState::reset
void reset()
Definition: SessionState.h:222
FIX::Session::checkSessionTime
bool checkSessionTime(const UtcTimeStamp &timeStamp)
Definition: Session.h:286
FIX::SessionRejectReason_VALUE_IS_INCORRECT_TEXT
const char SessionRejectReason_VALUE_IS_INCORRECT_TEXT[]
Definition: Values.h:58
FIX::Session::generateBusinessReject
void generateBusinessReject(const Message &, int err, int field=0)
Definition: Session.cpp:946
FIX::Session::m_targetDefaultApplVerID
std::string m_targetDefaultApplVerID
Definition: Session.h:355
FIX::Session::doTargetTooLow
bool doTargetTooLow(const Message &msg)
Definition: Session.cpp:1201
FIX::Session::m_resetOnLogout
bool m_resetOnLogout
Definition: Session.h:361
FIX::SessionState::alreadySentLogon
bool alreadySentLogon() const
Definition: SessionState.h:147
FIX::BeginString_FIX41
const char BeginString_FIX41[]
Definition: Values.h:50
FIX::Message::toApplVerID
static ApplVerID toApplVerID(const BeginString &value)
Definition: Message.h:322
FIX::Session::m_maxLatency
int m_maxLatency
Definition: Session.h:359
FIX::Session::setTargetDefaultApplVerID
void setTargetDefaultApplVerID(const std::string &targetDefaultApplVerID)
Definition: Session.h:160
FIX::SessionID::isFIXT
const bool isFIXT() const
Definition: SessionID.h:92
FIX::Session::setMaxLatency
void setMaxLatency(int value)
Definition: Session.h:180
FIX::SessionRejectReason_COMPID_PROBLEM_TEXT
const char SessionRejectReason_COMPID_PROBLEM_TEXT[]
Definition: Values.h:62
FIX::Session::generateReject
void generateReject(const Message &, int err, int field=0)
Definition: Session.cpp:820
FIX::Session::nextReject
void nextReject(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:327
FIX::SessionState::withinHeartBeat
bool withinHeartBeat() const
Definition: SessionState.h:158
FIX::Application::toAdmin
virtual void toAdmin(Message &, const SessionID &)=0
Notification of admin message being sent to target.
FIX::Session::lookupSession
static Session * lookupSession(const SessionID &)
Definition: Session.cpp:1511
FIX::SessionState::logonTimeout
int logonTimeout() const
Definition: SessionState.h:102
FIX::Session::nextLogon
void nextLogon(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:217
FIX::MessageStoreFactory::create
virtual MessageStore * create(const SessionID &)=0
FIX::SessionState::getNextTargetMsgSeqNum
int getNextTargetMsgSeqNum() const
Definition: SessionState.h:210
FIX::Session::m_resetOnLogon
bool m_resetOnLogon
Definition: Session.h:360
FIX::SessionState::testRequest
int testRequest() const
Definition: SessionState.h:108
FIX::SessionState::timedOut
bool timedOut() const
Definition: SessionState.h:164
FIX::BeginString_FIX42
const char BeginString_FIX42[]
Definition: Values.h:49
FIX::Session::verify
bool verify(const Message &msg, bool checkTooHigh=true, bool checkTooLow=true)
Definition: Session.cpp:1049
FIX::SessionState::queue
void queue(int msgSeqNum, const Message &message)
Definition: SessionState.h:186
FIX::BusinessRejectReason_NOT_AUTHORIZED_TEXT
const char BusinessRejectReason_NOT_AUTHORIZED_TEXT[]
Definition: Values.h:74
FIX::BusinessRejectReason_UNKNOWN_ID_TEXT
const char BusinessRejectReason_UNKNOWN_ID_TEXT[]
Definition: Values.h:69
FIX::Session::getExpectedTargetNum
int getExpectedTargetNum()
Definition: Session.h:256
FIX::Session::Sessions
std::map< SessionID, Session * > Sessions
Definition: Session.h:264
FIX::Session::s_sessionIDs
static SessionIDs s_sessionIDs
Definition: Session.h:376
LOGEX
#define LOGEX(method)
Definition: Session.cpp:53
FIX::Session::isTargetTooLow
bool isTargetTooLow(const MsgSeqNum &msgSeqNum)
Definition: Session.h:293
FIX::DataDictionary::getMessageOrderedFields
message_order const & getMessageOrderedFields(const std::string &msgType) const
Definition: DataDictionary.cpp:498
FIX::Session::m_timestampPrecision
int m_timestampPrecision
Definition: Session.h:364
FIX::SessionState::needTestRequest
bool needTestRequest() const
Definition: SessionState.h:174
FIX::Session::reset
void reset()
Definition: Session.h:97
FIX::Session::refresh
void refresh()
Definition: Session.h:99
FIX::SessionState::receivedReset
bool receivedReset() const
Definition: SessionState.h:93
FIX::Session::setResetOnLogout
void setResetOnLogout(bool value)
Definition: Session.h:200
FIX::SessionState::getNextSenderMsgSeqNum
int getNextSenderMsgSeqNum() const
Definition: SessionState.h:208
FIX::Session::removeSession
static void removeSession(Session &)
Definition: Session.cpp:1588
FIX::SessionRejectReason_INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP_TEXT
const char SessionRejectReason_INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP_TEXT[]
Definition: Values.h:67
FIX::SessionRejectReason_REQUIRED_TAG_MISSING_TEXT
const char SessionRejectReason_REQUIRED_TAG_MISSING_TEXT[]
Definition: Values.h:54
FIELD_THROW_IF_NOT_FOUND
#define FIELD_THROW_IF_NOT_FOUND(MAP, FLD)
Definition: FieldMap.h:377
FIX::Session::getSessions
static std::set< SessionID > getSessions()
Definition: Session.cpp:1500
FIX::Session::m_persistMessages
bool m_persistMessages
Definition: Session.h:365
FIX::Session::doBadCompID
void doBadCompID(const Message &msg)
Definition: Session.cpp:1167
FIX::Session::s_sessions
static Sessions s_sessions
Definition: Session.h:375
FIX::Session::registerSession
static Session * registerSession(const SessionID &)
Definition: Session.cpp:1552
FIX::BusinessRejectReason_UNSUPPORTED_MESSAGE_TYPE_TEXT
const char BusinessRejectReason_UNSUPPORTED_MESSAGE_TYPE_TEXT[]
Definition: Values.h:71
FIX::SessionState::ResendRange
std::pair< int, int > ResendRange
Definition: SessionState.h:114
FIX::Session::m_sessionID
SessionID m_sessionID
Definition: Session.h:350
FIX::SessionState::onOutgoing
void onOutgoing(const std::string &string)
Definition: SessionState.h:233
FIX::MessageStoreFactory::destroy
virtual void destroy(MessageStore *)=0
FIX::SessionState::log
Log * log()
Definition: SessionState.h:122
FIX::Responder::send
virtual bool send(const std::string &)=0
FIX::BusinessRejectReason_CONDITIONALLY_REQUIRED_FIELD_MISSING_TEXT
const char BusinessRejectReason_CONDITIONALLY_REQUIRED_FIELD_MISSING_TEXT[]
Definition: Values.h:73
FIX::SessionState::sentLogout
bool sentLogout() const
Definition: SessionState.h:87
FIX::Session::doBadTime
void doBadTime(const Message &msg)
Definition: Session.cpp:1161
FIX::Session::m_sendRedundantResendRequests
bool m_sendRedundantResendRequests
Definition: Session.h:356
FIX::Session::generateSequenceReset
void generateSequenceReset(int, int)
Definition: Session.cpp:758
FIX::Session::m_sessionTime
TimeRange m_sessionTime
Definition: Session.h:351
FIX::Session::generateResendRequest
void generateResendRequest(const BeginString &, const MsgSeqNum &)
Definition: Session.cpp:733
FIX::Session::setCheckLatency
void setCheckLatency(bool value)
Definition: Session.h:175
FIX::Session::next
void next()
Definition: Session.cpp:140
FIX::SessionState::retrieve
bool retrieve(int msgSeqNum, Message &message)
Definition: SessionState.h:188
FIX::IOException
IO Error.
Definition: Exceptions.h:253
FIX::Session::m_state
SessionState m_state
Definition: Session.h:368
FIX::Session::m_messageStoreFactory
MessageStoreFactory & m_messageStoreFactory
Definition: Session.h:370
FIX::SessionState::get
void get(int b, int e, std::vector< std::string > &m) const
Definition: SessionState.h:205
FIX::Session::m_senderDefaultApplVerID
std::string m_senderDefaultApplVerID
Definition: Session.h:354
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:938
FIX::SessionState::initiate
bool initiate() const
Definition: SessionState.h:99
FIX::Session::validLogonState
bool validLogonState(const MsgType &msgType)
Definition: Session.cpp:1132
FIX::DataDictionaryProvider::getSessionDataDictionary
const DataDictionary & getSessionDataDictionary(const BeginString &beginString) const
Definition: DataDictionaryProvider.cpp:53
FIX::BeginString_FIXT11
const char BeginString_FIXT11[]
Definition: Values.h:45
FIX::Session::s_registered
static Sessions s_registered
Definition: Session.h:377
FIX::IntConvertor::convert
static std::string convert(signed_int value)
Definition: FieldConvertors.h:168
FIX::DataDictionaryProvider::getApplicationDataDictionary
const DataDictionary & getApplicationDataDictionary(const ApplVerID &applVerID) const
Definition: DataDictionaryProvider.cpp:64
FIX::Session::setResetOnDisconnect
void setResetOnDisconnect(bool value)
Definition: Session.h:205
FIX::Session::isLogonTime
bool isLogonTime(const UtcTimeStamp &time)
Definition: Session.h:141
FIX::Session::m_checkLatency
bool m_checkLatency
Definition: Session.h:358
FIX::Session::getLog
Log * getLog()
Definition: Session.h:258
FIX::SessionRejectReason_TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE_TEXT
const char SessionRejectReason_TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE_TEXT[]
Definition: Values.h:55
FIX::DataDictionary::getHeaderOrderedFields
message_order const & getHeaderOrderedFields() const
Definition: DataDictionary.cpp:458
FIX::SessionID::getBeginString
const BeginString & getBeginString() const
Definition: SessionID.h:84
FIX::Session::generateLogon
void generateLogon()
Definition: Session.cpp:688
FIX::Session::isSessionRegistered
static bool isSessionRegistered(const SessionID &)
Definition: Session.cpp:1546
FIX::LogFactory::destroy
virtual void destroy(Log *)=0
FIX::Session::generateTestRequest
void generateTestRequest(const std::string &)
Definition: Session.cpp:807
FIX::Session::populateRejectReason
void populateRejectReason(Message &, int field, const std::string &)
Definition: Session.cpp:1024
FIX::Session::fromCallback
void fromCallback(const MsgType &msgType, const Message &msg, const SessionID &sessionID)
Definition: Session.cpp:1152
FIX::SessionRejectReason_TAG_APPEARS_MORE_THAN_ONCE_TEXT
const char SessionRejectReason_TAG_APPEARS_MORE_THAN_ONCE_TEXT[]
Definition: Values.h:65
FIX::Session::setLogoutTimeout
void setLogoutTimeout(int value)
Definition: Session.h:190
FIX::Session::Session
Session(Application &, MessageStoreFactory &, const SessionID &, const DataDictionaryProvider &, const TimeRange &, int heartBtInt, LogFactory *pLogFactory)
Definition: Session.cpp:56
FIX::Session::sendRaw
bool sendRaw(Message &, int msgSeqNum=0)
Definition: Session.cpp:545
FIX::BusinessRejectReason_OTHER_TEXT
const char BusinessRejectReason_OTHER_TEXT[]
Definition: Values.h:68
FIX::SessionRejectReason_INVALID_TAG_NUMBER_TEXT
const char SessionRejectReason_INVALID_TAG_NUMBER_TEXT[]
Definition: Values.h:53
FIX::Session::doPossDup
bool doPossDup(const Message &msg)
Definition: Session.cpp:1173
FIX::SessionState::onIncoming
void onIncoming(const std::string &string)
Definition: SessionState.h:231
FIX::BusinessRejectReason_DELIVERTO_FIRM_NOT_AVAILABLE_AT_THIS_TIME_TEXT
const char BusinessRejectReason_DELIVERTO_FIRM_NOT_AVAILABLE_AT_THIS_TIME_TEXT[]
Definition: Values.h:75
FIX::SessionState::logoutTimeout
int logoutTimeout() const
Definition: SessionState.h:105
FIX::Session::fill
void fill(Header &)
Definition: Session.cpp:129
FIX::Message::isAdminMsgType
static bool isAdminMsgType(const MsgType &msgType)
Definition: Message.h:315
FIX::DataDictionary::validate
static void validate(const Message &message, const DataDictionary *const pSessionDD, const DataDictionary *const pAppID)
Validate a message.
Definition: DataDictionary.cpp:123
FIX::Session::isLoggedOn
bool isLoggedOn()
Definition: Session.h:96
FIX::SessionState::lastReceivedTime
void lastReceivedTime(const UtcTimeStamp &value)
Definition: SessionState.h:139
FIX::Session::addSession
static bool addSession(Session &)
Definition: Session.cpp:1574
FIX::Session::isCorrectCompID
bool isCorrectCompID(const SenderCompID &senderCompID, const TargetCompID &targetCompID)
Definition: Session.h:295
FIX::SessionState::receivedLogon
bool receivedLogon() const
Definition: SessionState.h:84
FIX::SessionState::shouldSendLogon
bool shouldSendLogon() const
Definition: SessionState.h:146
FIX::Session::m_application
Application & m_application
Definition: Session.h:349
reverse
void reverse(I begin, I end)
Definition: pugixml.cpp:6009
FIX::Session::getExpectedSenderNum
int getExpectedSenderNum()
Definition: Session.h:255
FIX::SessionState::resendRequested
bool resendRequested() const
Definition: SessionState.h:111
FIX::Session::isEnabled
bool isEnabled()
Definition: Session.h:90
FIX::Session::doTargetTooHigh
void doTargetTooHigh(const Message &msg)
Definition: Session.cpp:1221
FIX::Application::onCreate
virtual void onCreate(const SessionID &)=0
Notification of a session begin created.
FIX::TimeRange::isInRange
static bool isInRange(const UtcTimeOnly &start, const UtcTimeOnly &end, const DateTime &time)
Definition: TimeRange.h:74
FIX::SessionState::store
MessageStore * store()
Definition: SessionState.h:120
FIX::Session::nextSequenceReset
void nextSequenceReset(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:334
FIX::Session::isTargetTooHigh
bool isTargetTooHigh(const MsgSeqNum &msgSeqNum)
Definition: Session.h:291
FIX::Session::nextResendRequest
void nextResendRequest(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:359
FIX::SessionRejectReason_SENDINGTIME_ACCURACY_PROBLEM_TEXT
const char SessionRejectReason_SENDINGTIME_ACCURACY_PROBLEM_TEXT[]
Definition: Values.h:63
FIX::Session::shouldSendReset
bool shouldSendReset()
Definition: Session.cpp:1121
FIX::SessionState::logoutTimedOut
bool logoutTimedOut() const
Definition: SessionState.h:153
FIX::Session::generateHeartbeat
void generateHeartbeat()
Definition: Session.cpp:779
FIX::Session::disconnect
void disconnect()
Definition: Session.cpp:628
FIX::Session::nextHeartbeat
void nextHeartbeat(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:295
FIX::Session::setResetOnLogon
void setResetOnLogon(bool value)
Definition: Session.h:195
FIX::SessionRejectReason_INVALID_MSGTYPE_TEXT
const char SessionRejectReason_INVALID_MSGTYPE_TEXT[]
Definition: Values.h:64
FIX::Session::m_logonTime
TimeRange m_logonTime
Definition: Session.h:352
FIX::SessionState::sentReset
bool sentReset() const
Definition: SessionState.h:96
FIX::Session::~Session
virtual ~Session()
Definition: Session.cpp:98
FIX::Session::logon
void logon()
Definition: Session.h:86
FIX::SessionRejectReason_TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER_TEXT
const char SessionRejectReason_TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER_TEXT[]
Definition: Values.h:66
FIX::Session::sendToTarget
static bool sendToTarget(Message &message, const std::string &qualifier="")
Definition: Session.cpp:1459
FIX::Session::setMillisecondsInTimeStamp
void setMillisecondsInTimeStamp(bool value)
Definition: Session.h:215
FIX::identifyType
MsgType identifyType(const std::string &message)
Parse the type of a message from a string.
Definition: Message.h:432
FIX::Application::onLogon
virtual void onLogon(const SessionID &)=0
Notification of a session successfully logging on.
FIX::Session::m_pResponder
Responder * m_pResponder
Definition: Session.h:372
FIX::SessionRejectReason_TAG_SPECIFIED_WITHOUT_A_VALUE_TEXT
const char SessionRejectReason_TAG_SPECIFIED_WITHOUT_A_VALUE_TEXT[]
Definition: Values.h:57
FIX::SessionState::needHeartbeat
bool needHeartbeat() const
Definition: SessionState.h:169
FIX::Session::logout
void logout(const std::string &reason="")
Definition: Session.h:88
FIX::Application::fromApp
virtual void fromApp(const Message &, const SessionID &)=0
Notification of app message being received from target.
FIX::Session::persist
void persist(const Message &, const std::string &)
Definition: Session.cpp:678
FIX::Session::nextTestRequest
void nextTestRequest(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:302
FIX::SessionState::onEvent
void onEvent(const std::string &string)
Definition: SessionState.h:235
FIX::Session::m_dataDictionaryProvider
DataDictionaryProvider m_dataDictionaryProvider
Definition: Session.h:369
FIX::Session::m_mutex
Mutex m_mutex
Definition: Session.h:373
FIX::Session::s_mutex
static Mutex s_mutex
Definition: Session.h:378
FIX::Session::m_validateLengthAndChecksum
bool m_validateLengthAndChecksum
Definition: Session.h:366
FIX::BusinessRejectReason_UNKNOWN_SECURITY_TEXT
const char BusinessRejectReason_UNKNOWN_SECURITY_TEXT[]
Definition: Values.h:70
FIX::LogFactory::create
virtual Log * create()=0
FIX::Session::generateLogout
void generateLogout(const std::string &text="")
Definition: Session.cpp:1011
FIX::Session::getStore
const MessageStore * getStore()
Definition: Session.h:259
FIX::Session::insertSendingTime
void insertSendingTime(Header &)
Definition: Session.cpp:106
FIX::BusinessRejectReason_APPLICATION_NOT_AVAILABLE_TEXT
const char BusinessRejectReason_APPLICATION_NOT_AVAILABLE_TEXT[]
Definition: Values.h:72
FIELD_GET_REF
#define FIELD_GET_REF(MAP, FLD)
Definition: FieldMap.h:375
FIX::Session::resend
bool resend(Message &message)
Definition: Session.cpp:658
FIX::SessionState::set
bool set(int s, const std::string &m)
Definition: SessionState.h:203
FIX::SessionRejectReason_INCORRECT_DATA_FORMAT_FOR_VALUE_TEXT
const char SessionRejectReason_INCORRECT_DATA_FORMAT_FOR_VALUE_TEXT[]
Definition: Values.h:59
FIX::Session::setRefreshOnLogon
void setRefreshOnLogon(bool value)
Definition: Session.h:210
FIX::Session::nextLogout
void nextLogout(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:310
FIX::Session::m_refreshOnLogon
bool m_refreshOnLogon
Definition: Session.h:363
FIX::SessionState::incrNextSenderMsgSeqNum
void incrNextSenderMsgSeqNum()
Definition: SessionState.h:216
FIX::Application::toApp
virtual void toApp(Message &, const SessionID &)=0
Notification of app message being sent to target.
FIX::SessionState::incrNextTargetMsgSeqNum
void incrNextTargetMsgSeqNum()
Definition: SessionState.h:218
FIX::Session::m_pLogFactory
LogFactory * m_pLogFactory
Definition: Session.h:371
FIX::SessionState::resendRange
ResendRange resendRange() const
Definition: SessionState.h:116
FIX::SessionState::logonTimedOut
bool logonTimedOut() const
Definition: SessionState.h:148
FIX::Session::m_resetOnDisconnect
bool m_resetOnDisconnect
Definition: Session.h:362
FIX::Session::setLogonTimeout
void setLogonTimeout(int value)
Definition: Session.h:185
FIX::Application::fromAdmin
virtual void fromAdmin(const Message &, const SessionID &)=0
Notification of admin message being received from target.
FIX::Session::send
bool send(Message &)
Definition: Session.cpp:538
FIX::Session::insertOrigSendingTime
void insertOrigSendingTime(Header &, const UtcTimeStamp &when=UtcTimeStamp())
Definition: Session.cpp:118
FIX::SessionState::heartBtInt
void heartBtInt(const HeartBtInt &value)
Definition: SessionState.h:125
FIX::Session::newMessage
Message * newMessage(const std::string &msgType) const
Definition: Session.cpp:507
FIX::Session::nextQueued
void nextQueued(const UtcTimeStamp &timeStamp)
Definition: Session.cpp:1253

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2001