#include <B2BITS_Session.h>


Public Types | |
| enum | ActiveConnection { PRIMARY_CONNECTION = 0, BACKUP_CONNECTION, RESTORE_CONNECTION } |
| enum | State { ESTABLISHED, INITIAL, NON_GRACEFULLY_TERMINATED, RECONNECT, CORRECTLY_TERMINATED, WAIT_FOR_CONFIRM_LOGON, WAIT_FOR_CONFIRM_LOGOUT, WAIT_FOR_FIRST_LOGON, SWITCH_CONNECTION, WAIT_FOR_FIRST_HELLO, WAIT_FOR_CONFIRM_HELLO } |
| enum | Role { NA, INITIATOR, ACCEPTOR } |
| Defines role of session. More... | |
Public Member Functions | |
| virtual void | connect (EncryptMethod encryption=Engine::NONE)=0 |
| virtual void | connect (int HBI, const std::string &host, int port, EncryptMethod encryption=Engine::NONE, const SessionBackupParameters *backupConn=NULL, ActiveConnection activeConn=PRIMARY_CONNECTION)=0 |
| virtual void | connect (int HBI, const FIXMessage &customLogonMsg, const std::string &host, int port, EncryptMethod encryption=Engine::NONE, const SessionBackupParameters *backupConn=NULL, ActiveConnection activeConn=PRIMARY_CONNECTION)=0 |
| virtual void | connect (const FixTcpParameters &protocolConfig, const FixTcpBackupParameters *backupConn=NULL)=0 |
| virtual void | connect (const FixT11TcpParameters &protocolConfig, const FixT11TcpBackupParameters *backupConn=NULL)=0 |
| virtual UnderlyingProtocol | getUnderlyingProtocol () const =0 |
| virtual void | disconnect (bool forcefullyMarkAsTerminated=false)=0 |
| virtual void | disconnect (const std::string &logoutText, bool forcefullyMarkAsTerminated=false)=0 |
| virtual void | disconnectNonGracefully ()=0 |
| virtual void | switchConnection ()=0 |
| virtual void | resetSeqNum ()=0 |
| virtual Application * | registerApplication (Application *pNewApplication, unsigned int delay=300, int maxTries=-1)=0 |
| virtual void | put (FIXMessage *pMsg)=0 |
| virtual void | put (const std::string &msgHeader, const std::string &msgBody)=0 |
| virtual State | getState ()=0 |
| virtual const char * | getStateAsString ()=0 |
| virtual void | setInSeqNum (int seqNum)=0 |
| virtual void | setOutSeqNum (int seqNum)=0 |
| virtual void | setSenderLocationID (const std::string &id)=0 |
| virtual void | setTargetLocationID (const std::string &id)=0 |
| virtual void | setSenderSubID (const std::string &id)=0 |
| virtual void | setTargetSubID (const std::string &id)=0 |
| virtual void | setEnableMessageRejecting (bool enable)=0 |
| virtual void | setIntradayLogoutToleranceMode (bool enable)=0 |
| virtual void | setForcedReconnect (bool enable)=0 |
| virtual const std::string * | getSender () const =0 |
| virtual const std::string * | getTarget () const =0 |
| virtual int | getHBI () const =0 |
| virtual FIXVersion | getVer () const =0 |
| virtual int | getInSeqNum ()=0 |
| virtual int | getOutSeqNum ()=0 |
| virtual void | ping (const std::string &testReqID="")=0 |
| virtual int | getRemotePort ()=0 |
| virtual const std::string * | getRemoteHost ()=0 |
| virtual const System::InetAddress & | getRemoteAddress () const =0 |
| virtual Role | getRole () const =0 |
| virtual const std::string * | getId () const =0 |
| virtual Engine::EncryptMethod | getEncryptionMethod () const =0 |
| Returns the encryption method. | |
| virtual bool | setTCPBuffer (bool enable)=0 |
| virtual bool | isTCPBuffer () const =0 |
| virtual void | getReceivedMessages (std::vector< FIXMessage * > *pMessages, const MsgFilter &msgFilter) const =0 |
| virtual const std::string * | getMsgStorageName () const =0 |
| virtual SessionEx * | getSessionEx () |
| virtual FIXMessage * | locateSentMessage (int seqNum) const =0 |
| virtual FIXMessage * | newSkel (const char *msgType) const =0 |
Static Public Member Functions | |
| static const char * | state2string (State state) |
Protected Member Functions | |
| Session () | |
| virtual | ~Session () |
Friends | |
| class | SessionDataProvider |
Possible states of Session.
| Engine::Session::Session | ( | ) | [inline, protected] |
Constructor.
| virtual Engine::Session::~Session | ( | ) | [inline, protected, virtual] |
Destructor.
| virtual void Engine::Session::connect | ( | EncryptMethod | encryption = Engine::NONE |
) | [pure virtual] |
Establishes the FIX session as Acceptor.
| encryption | Encrypt method. |
| virtual void Engine::Session::connect | ( | int | HBI, | |
| const std::string & | host, | |||
| int | port, | |||
| EncryptMethod | encryption = Engine::NONE, |
|||
| const SessionBackupParameters * | backupConn = NULL, |
|||
| ActiveConnection | activeConn = PRIMARY_CONNECTION | |||
| ) | [pure virtual] |
Establishes the FIX session as Initiator.
| HBI | Heartbeat interval (seconds) | |
| host | remote FIX engine's host name or address. | |
| port | remote FIX engine's port. | |
| encryption | Encrypt method. | |
| backupConn | - parameters of the backup connection | |
| activeConn | - specifies which connection will be used, by default primary connection |
| virtual void Engine::Session::connect | ( | int | HBI, | |
| const FIXMessage & | customLogonMsg, | |||
| const std::string & | host, | |||
| int | port, | |||
| EncryptMethod | encryption = Engine::NONE, |
|||
| const SessionBackupParameters * | backupConn = NULL, |
|||
| ActiveConnection | activeConn = PRIMARY_CONNECTION | |||
| ) | [pure virtual] |
Establishes the FIX session as Initiator using the custom Logon message.
| HBI | Heartbeat interval (in seconds) | |
| customLogonMsg | the custom Logon message. | |
| host | remote FIX engine's host name or address. | |
| port | remote FIX engine's port. | |
| encryption | Encrypt method. | |
| backupConn | - parameters of the backup connection | |
| activeConn | - specifies which connection will be used, by default primary connection |
| virtual void Engine::Session::connect | ( | const FixTcpParameters & | protocolConfig, | |
| const FixTcpBackupParameters * | backupConn = NULL | |||
| ) | [pure virtual] |
Establishes the FIX session over FIX_TCP underlying protocol.
| protocolConfig | - set of the FIX_TCP protocol parameters. | |
| backupConn | - parameters of the backup connection |
| virtual void Engine::Session::connect | ( | const FixT11TcpParameters & | protocolConfig, | |
| const FixT11TcpBackupParameters * | backupConn = NULL | |||
| ) | [pure virtual] |
Establishes the FIX session over FIXT11_TCP underlying protocol.
| protocolConfig | - set of the FIXT11_TCP protocol parameters. | |
| backupConn | - parameters of the backup connection |
| virtual UnderlyingProtocol Engine::Session::getUnderlyingProtocol | ( | ) | const [pure virtual] |
Returns type of the underlying protocol
| virtual void Engine::Session::disconnect | ( | bool | forcefullyMarkAsTerminated = false |
) | [pure virtual] |
Initiates disconnect of the session.
| forcefullyMarkAsTerminated | if true then the session will be marked as correctly terminated and persistant information about it will not be used during the subsequent connections. |
| virtual void Engine::Session::disconnect | ( | const std::string & | logoutText, | |
| bool | forcefullyMarkAsTerminated = false | |||
| ) | [pure virtual] |
Initiates disconnect of the session with the given logout text.
| forcefullyMarkAsTerminated | if true then the session will be marked as correctly terminated and persistant | |
| logoutText | Reason of disconnecting information about it will not be used during the subsequent connections. |
| virtual void Engine::Session::disconnectNonGracefully | ( | ) | [pure virtual] |
Closes the telecommunication link and switches the session into the NON_GRACEFULLY_TERMINATED state.
| virtual void Engine::Session::switchConnection | ( | ) | [pure virtual] |
Switch session to the another connection. When current is a primary - switch to the backup. When current is a backup - switch to the primary.
| virtual void Engine::Session::resetSeqNum | ( | ) | [pure virtual] |
Sends the Logon message with the ResetSeqNumFlag flat that indicates both sides of a FIX session should reset sequence numbers.
| virtual Application* Engine::Session::registerApplication | ( | Application * | pNewApplication, | |
| unsigned int | delay = 300, |
|||
| int | maxTries = -1 | |||
| ) | [pure virtual] |
Registers Application. When any application callback executed - new Application coudn't be registered immediately. Session will tries to register new application during delay*triesAmount period.
| pNewApplication | Instance of class derived from Application that handles session's events. | |
| delay | - the time delay in microseconds when session tries to registrate new application | |
| maxTries | - the amount of attempts during session tries to registrate new application. '-1' means INFINITE attempt. |
| virtual void Engine::Session::put | ( | FIXMessage * | pMsg | ) | [pure virtual] |
Sends the given message to the remote FIX engine.
| virtual void Engine::Session::put | ( | const std::string & | msgHeader, | |
| const std::string & | msgBody | |||
| ) | [pure virtual] |
Sends the given message to the remote FIX engine.
| msgHeader | the message header in the native FIX format. | |
| msgBody | the message body in the native FIX format. |
msgHeader must contain at least the 'BeginString' and 'MsgType' fields.
Method throws Utils::Exception in case message is incorrect or session is closed.
| virtual State Engine::Session::getState | ( | ) | [pure virtual] |
| virtual const char* Engine::Session::getStateAsString | ( | ) | [pure virtual] |
| static const char* Engine::Session::state2string | ( | State | state | ) | [static] |
Returns the string representation of the given state value.
| virtual void Engine::Session::setInSeqNum | ( | int | seqNum | ) | [pure virtual] |
Forcedly sets the value of the incoming sequence number (the expected MsgSeqNum of the next incoming message).
| virtual void Engine::Session::setOutSeqNum | ( | int | seqNum | ) | [pure virtual] |
Forcedly sets the value of the outgoing sequence number (MsgSeqNum of the next outgoing message).
| virtual void Engine::Session::setSenderLocationID | ( | const std::string & | id | ) | [pure virtual] |
Forcedly sets the value of the Sender Location ID.
| virtual void Engine::Session::setTargetLocationID | ( | const std::string & | id | ) | [pure virtual] |
Forcedly sets the value of the Target Location ID.
| virtual void Engine::Session::setSenderSubID | ( | const std::string & | id | ) | [pure virtual] |
Forcedly sets the value of the Sender Sub ID.
| virtual void Engine::Session::setTargetSubID | ( | const std::string & | id | ) | [pure virtual] |
Forcedly sets the value of the Target Sub ID.
| virtual void Engine::Session::setEnableMessageRejecting | ( | bool | enable | ) | [pure virtual] |
Forcedly sets the value of the Enable Message Rejecting.
| virtual void Engine::Session::setIntradayLogoutToleranceMode | ( | bool | enable | ) | [pure virtual] |
Forcedly sets the value of the Intraday Logout Tolerance Mode.
| virtual void Engine::Session::setForcedReconnect | ( | bool | enable | ) | [pure virtual] |
Forcedly sets the value of the Forced Reconnect.
| virtual const std::string* Engine::Session::getSender | ( | ) | const [pure virtual] |
Returns SenderCompID.
| virtual const std::string* Engine::Session::getTarget | ( | ) | const [pure virtual] |
Returns TargetCompID.
| virtual int Engine::Session::getHBI | ( | ) | const [pure virtual] |
Returns Heartbeat interval (HeartBtInt) in seconds.
| virtual FIXVersion Engine::Session::getVer | ( | ) | const [pure virtual] |
Returns the FIX protocol version.
| virtual int Engine::Session::getInSeqNum | ( | ) | [pure virtual] |
Returns the incoming sequence numbers for this FIX session (the expected MsgSeqNum of the next incoming message).
| virtual int Engine::Session::getOutSeqNum | ( | ) | [pure virtual] |
Returns the outgoing sequence numbers for this FIX session (MsgSeqNum of the next outgoing message).
| virtual void Engine::Session::ping | ( | const std::string & | testReqID = "" |
) | [pure virtual] |
Sends Test Request message.
| testReqID | The TestReqID field (tag = 112) - Identifier included in Test Request message to be returned in resulting Heartbeat message. If empty then a timestamp string will be used as the value. |
| virtual int Engine::Session::getRemotePort | ( | ) | [pure virtual] |
Returns the remote FIX Engine's port number.
| virtual const std::string* Engine::Session::getRemoteHost | ( | ) | [pure virtual] |
| virtual const System::InetAddress& Engine::Session::getRemoteAddress | ( | ) | const [pure virtual] |
| virtual Role Engine::Session::getRole | ( | ) | const [pure virtual] |
Returns session's role.
| virtual const std::string* Engine::Session::getId | ( | ) | const [pure virtual] |
Returns the session's ID in the format 'SenderCompID 0x01 TargetCompId'.
| virtual bool Engine::Session::setTCPBuffer | ( | bool | enable | ) | [pure virtual] |
Enables or disables TCP buffer
| enable | - when true, TCP buffer will be enabled. |
| virtual void Engine::Session::getReceivedMessages | ( | std::vector< FIXMessage * > * | pMessages, | |
| const MsgFilter & | msgFilter | |||
| ) | const [pure virtual] |
Retrieves messages received by the session.
| pMessages | List of messages. | |
| msgFilter | specifies selection criteria. |
1.5.6