Session Class Reference

FIX Session - a bi-directional stream of ordered messages between two parties within a continuous sequence number series. More...

List of all members.

Public Types

enum  State {
  DISCONNECTED, LOGON_IN_PROGRESS, LOGOUT_IN_PROGRESS, ACTIVE,
  RECONNECTING
}
 Session state. More...
enum  EncryptionMethod { NONE, SSL }
enum  Role { NA, INITIATOR, ACCEPTOR }
 Session role. More...

Public Member Functions

 Session (const std::string &senderCompID, const std::string &targetCompID, Version version, bool keepSequenceNumbersAfterLogout, ISessionListener *listener)
 Constructor.
 Session (const std::string &senderCompID, const std::string &targetCompID, Version version, ISessionListener *listener)
 Constructor.
 ~Session ()
 Destructor.
State getState ()
 Returns the session state.
EncryptionMethod getEncryptionMethod () const
 Returns the current encryption method.
void setEncryptionMethod (EncryptionMethod newEncryptionMethod)
 Sets the encryption method.
void setSslCertificateFile (const std::string &file)
 Sets the SSL certificate file.
void setSslPrivateKeyFile (const std::string &file)
 Sets the SSL private key file.
void logonAsAcceptor ()
 Establishes the FIX Connection as Acceptor.
void logonAsInitiator (const std::string &host, int port, bool setResetSeqNumFlag)
 Establishes FIX Connection as Initiator using the ResetSeqNumFlag(141) field.
void logonAsInitiator (const std::string &host, int port)
 Establishes FIX Connection as Initiator.
void logonAsInitiator (const std::string &host, int port, int heartBtInt)
 Establishes FIX Connection as Initiator using the given Heartbeat interval (seconds).
void logonAsInitiator (const std::string &host, int port, int heartBtInt, bool setResetSeqNumFlag)
 Establishes FIX Connection as Initiator using the given Heartbeat interval (seconds) and the ResetSeqNumFlag(141) field.
void logonAsInitiator (const std::string &host, int port, int heartBtInt, Message *customLogonMsg)
 Establishes FIX Connection as Initiator using the custom Logon message.
void logonAsInitiator (const std::string &host, int port, int heartBtInt, Message *customLogonMsg, bool setResetSeqNumFlag)
 Establishes FIX Connection as Initiator using the custom Logon message and the ResetSeqNumFlag(141) field.
void logout ()
 Terminates the FIX Connection.
void logout (const std::string &text)
 Terminates the FIX Connection.
void send (Message *msg)
 Sends the message to the counterparty.
void shutdown ()
 Shutdowns the session.
 operator const std::string & ()
 Returns the string descripton of the session.
const std::string & getCounterpartyHost ()
 Returns the counterparty host name or address.
size_t getCounterpartyPort ()
 Returns the counterparty port number.
int getHeartBtInt ()
 Returns the Heartbeat interval (seconds).
int getInSeqNum ()
 Returns the expected sequence number of the next incoming message.
void setInSeqNum (int seqNum)
 Sets the expected sequence number of the next incoming message.
int getOutSeqNum ()
 Returns the sequence number of the next outgoing message.
void setOutSeqNum (int seqNum)
 Sets the sequence number of the next outgoing message.
Role getRole ()
 Returns the session role.
const std::string & getSenderCompID ()
 Returns the assigned value used to identify firm sending message (the SenderCompID (tag=49) field value in outgoing messages).
const std::string & getTargetCompID ()
 Returns the Assigned value used to identify receiving firm (the TargetCompID (tag=56) field value in outgoing messages).
Version getVersion ()
 Returns the session FIX Protocol version.
void reset ()
 Backups the current log files and resets the sequence numbers to 1.
void resetSeqNumViaLogonExchange ()
 Sends a Logon message with the ResetSeqNumFlag set.
void senderSubID (const std::string &value)
 Sets the SenderSubID (tag=50) field values for all outgoing messages.
void targetSubID (const std::string &value)
 Sets the TargetSubID (tag=57) field values for all outgoing messages.
void senderLocationID (const std::string &value)
 Sets the SenderLocationID (tag=142) field values for all outgoing messages.
void targetLocationID (const std::string &value)
 Sets the TargetLocationID (tag=143) field values for all outgoing messages.
void sendTestRequest (const std::string &testReqID="")
 Sends the Test Request (MsgType=1) message.

Static Public Member Functions

static const char * state2string (State state)
 Returns the session state as a string.


Detailed Description

FIX Session - a bi-directional stream of ordered messages between two parties within a continuous sequence number series.

Definition at line 19 of file Session.h.


Member Enumeration Documentation

enum State

Session state.

Enumerator:
DISCONNECTED 
LOGON_IN_PROGRESS 
LOGOUT_IN_PROGRESS 
ACTIVE 
RECONNECTING 

Definition at line 31 of file Session.h.

enum EncryptionMethod

Enumerator:
NONE  No encryption.
SSL  Secure Sockets Layer.

Definition at line 39 of file Session.h.

enum Role

Session role.

Enumerator:
NA 
INITIATOR 
ACCEPTOR 

Definition at line 153 of file Session.h.


Constructor & Destructor Documentation

Session ( const std::string &  senderCompID,
const std::string &  targetCompID,
Version  version,
bool  keepSequenceNumbersAfterLogout,
ISessionListener listener 
)

Constructor.

Session ( const std::string &  senderCompID,
const std::string &  targetCompID,
Version  version,
ISessionListener listener 
)

Constructor.

~Session (  ) 

Destructor.


Member Function Documentation

State getState (  ) 

Returns the session state.

static const char* state2string ( State  state  )  [static]

Returns the session state as a string.

EncryptionMethod getEncryptionMethod (  )  const

Returns the current encryption method.

void setEncryptionMethod ( EncryptionMethod  newEncryptionMethod  ) 

Sets the encryption method.

void setSslCertificateFile ( const std::string &  file  ) 

Sets the SSL certificate file.

Note:
Only the (Privacy Enhanced Mail) Base 64 Encoded (.pem) SSL certificates are supported.

void setSslPrivateKeyFile ( const std::string &  file  ) 

Sets the SSL private key file.

Note:
Only the (Privacy Enhanced Mail) Base 64 Encoded (.pem) SSL certificates are supported.

void logonAsAcceptor (  ) 

Establishes the FIX Connection as Acceptor.

Acceptor is the receiving party of the FIX session. It listens for the incoming connection on the pre-defined port. The acceptor has responsibility to perform first level authentication and formally declare the connection request "accepted" through transmission of an acknowledgment Logon message.

void logonAsInitiator ( const std::string &  host,
int  port,
bool  setResetSeqNumFlag 
)

Establishes FIX Connection as Initiator using the ResetSeqNumFlag(141) field.

Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.

void logonAsInitiator ( const std::string &  host,
int  port 
)

Establishes FIX Connection as Initiator.

Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.

void logonAsInitiator ( const std::string &  host,
int  port,
int  heartBtInt 
)

Establishes FIX Connection as Initiator using the given Heartbeat interval (seconds).

void logonAsInitiator ( const std::string &  host,
int  port,
int  heartBtInt,
bool  setResetSeqNumFlag 
)

Establishes FIX Connection as Initiator using the given Heartbeat interval (seconds) and the ResetSeqNumFlag(141) field.

void logonAsInitiator ( const std::string &  host,
int  port,
int  heartBtInt,
Message customLogonMsg 
)

Establishes FIX Connection as Initiator using the custom Logon message.

void logonAsInitiator ( const std::string &  host,
int  port,
int  heartBtInt,
Message customLogonMsg,
bool  setResetSeqNumFlag 
)

Establishes FIX Connection as Initiator using the custom Logon message and the ResetSeqNumFlag(141) field.

void logout (  ) 

Terminates the FIX Connection.

The initial Logout message is sent to the conterparty and the method blocks until the acknowledgement Logout message is received.

void logout ( const std::string &  text  ) 

Terminates the FIX Connection.

Parameters:
text Free format text string that is sent to the counterparty in the Text(58) field of the initial Logout message.

void send ( Message msg  ) 

Sends the message to the counterparty.

As soon as a session is created it is possible to start sending messages via the session. If the session is not established, the messages will be sent when the connection is established with the counterparty.

void shutdown (  ) 

Shutdowns the session.

operator const std::string & (  ) 

Returns the string descripton of the session.

const std::string& getCounterpartyHost (  ) 

Returns the counterparty host name or address.

size_t getCounterpartyPort (  ) 

Returns the counterparty port number.

int getHeartBtInt (  ) 

Returns the Heartbeat interval (seconds).

int getInSeqNum (  ) 

Returns the expected sequence number of the next incoming message.

void setInSeqNum ( int  seqNum  ) 

Sets the expected sequence number of the next incoming message.

int getOutSeqNum (  ) 

Returns the sequence number of the next outgoing message.

void setOutSeqNum ( int  seqNum  ) 

Sets the sequence number of the next outgoing message.

Role getRole (  ) 

Returns the session role.

const std::string& getSenderCompID (  ) 

Returns the assigned value used to identify firm sending message (the SenderCompID (tag=49) field value in outgoing messages).

const std::string& getTargetCompID (  ) 

Returns the Assigned value used to identify receiving firm (the TargetCompID (tag=56) field value in outgoing messages).

Version getVersion (  ) 

Returns the session FIX Protocol version.

void reset (  ) 

Backups the current log files and resets the sequence numbers to 1.

Note:
This method can be called only when the session is disconnected.

void resetSeqNumViaLogonExchange (  ) 

Sends a Logon message with the ResetSeqNumFlag set.

void senderSubID ( const std::string &  value  ) 

Sets the SenderSubID (tag=50) field values for all outgoing messages.

void targetSubID ( const std::string &  value  ) 

Sets the TargetSubID (tag=57) field values for all outgoing messages.

void senderLocationID ( const std::string &  value  ) 

Sets the SenderLocationID (tag=142) field values for all outgoing messages.

void targetLocationID ( const std::string &  value  ) 

Sets the TargetLocationID (tag=143) field values for all outgoing messages.

void sendTestRequest ( const std::string &  testReqID = ""  ) 

Sends the Test Request (MsgType=1) message.


The documentation for this class was generated from the following file:
Generated on Sun Jun 8 14:08:38 2008 for FIXForge C++ FIX Engine by  doxygen 1.5.2