Public Types | |
enum | SessionStorageType { FileBasedStorage, MemoryBasedStorage, PluggableStorage } |
enum | State { DISCONNECTED, LOGON_IN_PROGRESS, LOGOUT_IN_PROGRESS, ACTIVE, RECONNECTING } |
enum | EncryptionMethod { NONE, SSL } |
enum | Role { NA, INITIATOR, ACCEPTOR } |
Public Member Functions | |
Session (const std::string &senderCompId, const std::string &targetCompId, Version version, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, SessionStorageType storageType=FileBasedStorage, ISessionStorage *storage=NULL) | |
Session (const std::string &senderCompId, const std::string &targetCompId, Version version, ISessionListener *listener, SessionStorageType storageType=FileBasedStorage, ISessionStorage *storage=NULL) | |
Session (const std::string &senderCompId, const std::string &targetCompId, const Dialect &dialect, ISessionListener *listener, SessionStorageType storageType=FileBasedStorage, ISessionStorage *storage=NULL) | |
Session (const std::string &senderCompId, const std::string &targetCompId, const Dialect &dialect, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, SessionStorageType storageType=FileBasedStorage, ISessionStorage *storage=NULL) | |
Session (const std::string &senderCompId, const std::string &targetCompId, Version version, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, const std::string &customSessionKey, SessionStorageType storageType=FileBasedStorage, ISessionStorage *storage=NULL) | |
Session (const std::string &senderCompId, const std::string &targetCompId, const Dialect &dialect, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, const std::string &customSessionKey, SessionStorageType storageType=FileBasedStorage, ISessionStorage *storage=NULL) | |
~Session () | |
void | clearOutboundQueue () |
State | getState () |
EncryptionMethod | getEncryptionMethod () const |
void | setEncryptionMethod (EncryptionMethod newEncryptionMethod) |
int | getListenPort () const |
void | setListenPort (int listenPort) |
void | setLocalNetworkInterface (const std::string &localNetworkInterface) |
const std::string & | getLocalNetworkInterface () |
void | setTcpNoDelayOption (bool value=true) |
bool | getTcpNoDelayOption () const |
void | setSslCertificateFile (const std::string &file) |
void | setSslPrivateKeyFile (const std::string &file) |
void | setSslPrivateKeyPassword (const std::string &password) |
void | logonAsAcceptor () |
void | logonAsInitiator (const std::string &host, int port, bool setResetSeqNumFlag) |
void | logonAsInitiator (const std::string &host, int port) |
void | logonAsInitiator (const std::string &host, int port, int heartBtInt) |
void | logonAsInitiator (const std::string &host, int port, int heartBtInt, bool setResetSeqNumFlag) |
void | logonAsInitiator (const std::string &host, int port, int heartBtInt, Message *customLogonMsg) |
void | logonAsInitiator (const std::string &host, int port, int heartBtInt, Message *customLogonMsg, bool setResetSeqNumFlag) |
void | logout () |
void | logout (const std::string &text) |
void | logout (Message *customLogoutMessage) |
void | breakConnection () |
void | send (Message *message) |
void | shutdown () |
operator const std::string & () | |
const std::string & | getStorageID () |
std::string | getCounterpartyHost () |
std::string | getCounterpartyIpAddress () |
size_t | getCounterpartyPort () |
const std::string & | getCustomKey () const |
size_t | getOutboundQueueBytes () |
size_t | getOutboundQueueCount () |
int | getHeartBtInt () |
bool | getLogInboundMessages () const |
void | setLogInboundMessages (bool value) |
bool | getLogOutboundMessages () const |
void | setLogOutboundMessages (bool value) |
int | getInSeqNum () |
void | setInSeqNum (int seqNum) |
int | getOutSeqNum () |
void | setOutSeqNum (int seqNum) |
System::ThreadId | getReceivingThreadId () const |
Role | getRole () |
const std::string & | getSenderCompID () |
System::ThreadId | getSendingThreadId () const |
const std::string & | getTargetCompID () |
Version | getVersion () |
const Dialect & | dialect () |
Message * | findSentMessage (int messageSequenceNumber) |
void | registerListener (ISessionListener *listener) |
void | unregisterListener () |
void | reset () |
void | resetSeqNumViaLogonExchange () |
void | senderSubID (const std::string &value) |
void | targetSubID (const std::string &value) |
void | senderLocationID (const std::string &value) |
void | targetLocationID (const std::string &value) |
void | sendTestRequest (const std::string &testReqID="") |
Static Public Member Functions | |
static const char * | storageType2String (SessionStorageType value) |
static const char * | state2string (State state) |
Friends | |
struct | Engine::Impl |
FIX Session - a bi-directional stream of ordered messages between two parties within a continuous sequence number series.
enum EncryptionMethod |
enum SessionStorageType |
Session Storage type.
Session | ( | const std::string & | senderCompId, |
const std::string & | targetCompId, | ||
Version | version, | ||
bool | keepSequenceNumbersAfterLogout, | ||
OnixS::FIX::ISessionListener * | listener, | ||
SessionStorageType | storageType = FileBasedStorage , |
||
ISessionStorage * | storage = NULL |
||
) |
Creates the FIX Session.
senderCompId | Assigned value used to identify firm sending message (SenderCompID (tag=49) field value in outgoing messages). |
targetCompId | Assigned value used to identify receiving firm (TargetCompID (tag=56) field value in outgoing messages). |
version | Version of the FIX messaging specification (protocol) to be used by the session. |
keepSequenceNumbersAfterLogout | Option to keep sequence numbers after the exchange of Logout (MsgType=5) messages. |
listener | Instance of ISessionListener interface which will receive and handle miscellaneous Session events. |
storageType | Session storage type. |
storage | Pluggable Session storage. |
Session | ( | const std::string & | senderCompId, |
const std::string & | targetCompId, | ||
Version | version, | ||
ISessionListener * | listener, | ||
SessionStorageType | storageType = FileBasedStorage , |
||
ISessionStorage * | storage = NULL |
||
) |
Creates the FIX Session.
senderCompId | Assigned value used to identify firm sending message (SenderCompID (tag=49) field value in outgoing messages). |
targetCompId | Assigned value used to identify receiving firm (TargetCompID (tag=56) field value in outgoing messages). |
version | Version of the FIX messaging specification (protocol) to be used by the session. |
listener | Instance of ISessionListener interface which will receive and handle miscellaneous Session events. |
storageType | Session storage type. |
storage | Pluggable Session storage. |
Session | ( | const std::string & | senderCompId, |
const std::string & | targetCompId, | ||
const Dialect & | dialect, | ||
ISessionListener * | listener, | ||
SessionStorageType | storageType = FileBasedStorage , |
||
ISessionStorage * | storage = NULL |
||
) |
Creates the FIX Session.
senderCompId | Assigned value used to identify firm sending message (SenderCompID (tag=49) field value in outgoing messages). |
targetCompId | Assigned value used to identify receiving firm (TargetCompID (tag=56) field value in outgoing messages). |
dialect | FIX dialect to be used by the session. |
listener | Instance of ISessionListener interface which will receive and handle miscellaneous Session events. |
storageType | Session storage type. |
storage | Pluggable Session storage. |
Session | ( | const std::string & | senderCompId, |
const std::string & | targetCompId, | ||
const Dialect & | dialect, | ||
bool | keepSequenceNumbersAfterLogout, | ||
OnixS::FIX::ISessionListener * | listener, | ||
SessionStorageType | storageType = FileBasedStorage , |
||
ISessionStorage * | storage = NULL |
||
) |
Creates the FIX Session.
senderCompId | Assigned value used to identify firm sending message (SenderCompID (tag=49) field value in outgoing messages). |
targetCompId | Assigned value used to identify receiving firm (TargetCompID (tag=56) field value in outgoing messages). |
dialect | FIX dialect to be used by the session. |
keepSequenceNumbersAfterLogout | Option to keep sequence numbers after the exchange of Logout (MsgType=5) messages. |
listener | Instance of ISessionListener interface which will receive and handle miscellaneous Session events. |
storageType | Session storage type. |
storage | Pluggable Session storage. |
Session | ( | const std::string & | senderCompId, |
const std::string & | targetCompId, | ||
Version | version, | ||
bool | keepSequenceNumbersAfterLogout, | ||
OnixS::FIX::ISessionListener * | listener, | ||
const std::string & | customSessionKey, | ||
SessionStorageType | storageType = FileBasedStorage , |
||
ISessionStorage * | storage = NULL |
||
) |
Creates the FIX Session.
senderCompId | Assigned value used to identify firm sending message (SenderCompID (tag=49) field value in outgoing messages). |
targetCompId | Assigned value used to identify receiving firm (TargetCompID (tag=56) field value in outgoing messages). |
version | Version of the FIX messaging specification (protocol) to be used by the session. |
keepSequenceNumbersAfterLogout | Option to keep sequence numbers after the exchange of Logout (MsgType=5) messages. |
listener | Instance of ISessionListener interface which will receive and handle miscellaneous Session events. |
customSessionKey | Custom key that can be used to distinguish sessions with the same values of the SenderCompID, TargetCompID and the FIX Protocol version. |
storageType | Session storage type. |
storage | Pluggable Session storage. |
Session | ( | const std::string & | senderCompId, |
const std::string & | targetCompId, | ||
const Dialect & | dialect, | ||
bool | keepSequenceNumbersAfterLogout, | ||
OnixS::FIX::ISessionListener * | listener, | ||
const std::string & | customSessionKey, | ||
SessionStorageType | storageType = FileBasedStorage , |
||
ISessionStorage * | storage = NULL |
||
) |
Creates the FIX Session.
senderCompId | Assigned value used to identify firm sending message (SenderCompID (tag=49) field value in outgoing messages). |
targetCompId | Assigned value used to identify receiving firm (TargetCompID (tag=56) field value in outgoing messages). |
dialect | FIX dialect to be used by the session. |
keepSequenceNumbersAfterLogout | Option to keep sequence numbers after the exchange of Logout (MsgType=5) messages. |
listener | Instance of ISessionListener interface which will receive and handle miscellaneous Session events. |
customSessionKey | Custom key that can be used to distinguish sessions with the same values of the SenderCompID, TargetCompID and the FIX Protocol version. |
storageType | Session storage type. |
storage | Pluggable Session storage. |
void breakConnection | ( | ) |
Terminates FIX connection in the non-graceful way (without the exchange of Logout (MsgType=5) messages).
const Dialect& dialect | ( | ) |
Instance of the FIX dialect or standard FIX messages dictionary which is used by the session.
bool getLogInboundMessages | ( | ) | const |
bool getLogOutboundMessages | ( | ) | const |
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 logout | ( | ) |
Terminates the FIX Connection.
The initial Logout message is sent to the counterparty and the method blocks until the acknowledgment Logout message is received.
void logout | ( | Message * | customLogoutMessage | ) |
Terminates the FIX Connection.
customLogoutMessage | Custom Logout message that is sent to the counterparty. |
void logout | ( | const std::string & | text | ) |
Terminates the FIX Connection.
text | Free format text string that is sent to the counterparty in the Text(58) field of the initial Logout message. |
void registerListener | ( | ISessionListener * | listener | ) |
Registers the Session listener.
Exception | if the listener is already registered. |
void reset | ( | ) |
Backups the current log files and resets the sequence numbers to 1.
void send | ( | Message * | message | ) |
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 setSslCertificateFile | ( | const std::string & | file | ) |
Sets the SSL certificate file.
void setSslPrivateKeyFile | ( | const std::string & | file | ) |
Sets the SSL private key file.
void shutdown | ( | ) |
Shutdowns the session.