B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Engine::Session Class Referenceabstract

Basic Session. More...

#include <B2BITS_Session.h>

+ Inheritance diagram for Engine::Session:
+ Collaboration diagram for Engine::Session:

Public Types

enum  ActiveConnection { PRIMARY_CONNECTION = 0, BACKUP_CONNECTION, RESTORE_CONNECTION }
 Active connection to use. More...
 
typedef SessionRole Role
 Session role. More...
 
enum  SeqNumResetStrategy { RESET_SEQNUM_STRATEGY, RESET_SEQNUM_AND_SEND_LOGON_STRATEGY }
 Sequence numbers reset strategy. More...
 
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, WAIT_FOR_CONNECT
}
 Possible states of Session. More...
 

Public Member Functions

virtual void attachStateObserver (SessionStateObserver *observer)=0
 
virtual void closeMessageStorage ()=0
 Close message storage. More...
 
virtual void commitIncomingMessage (Engine::FIXMessageProcessElem *work) const =0
 Saves incoming message to the session storage if it is not commited yet. More...
 
virtual void connect (EncryptMethod encryption=Engine::NONE)=0
 Establishes the FIX session as Acceptor. More...
 
virtual void connect (int HBI, const std::string &host, int port, EncryptMethod encryption=Engine::NONE, const SessionBackupParameters *backupConn=NULL, ActiveConnection activeConn=PRIMARY_CONNECTION)=0
 Establishes the FIX session as Initiator. More...
 
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
 Establishes the FIX session as Initiator using the custom Logon message. More...
 
virtual void connect (const FixTcpParameters &protocolConfig, const FixTcpBackupParameters *backupConn=NULL)=0
 Establishes the FIX session over FIX_TCP underlying protocol. More...
 
virtual void connect (const FixT11TcpParameters &protocolConfig, const FixT11TcpBackupParameters *backupConn=NULL)=0
 Establishes the FIX session over FIXT11_TCP underlying protocol. More...
 
virtual void detachStateObserver ()=0
 
virtual void disconnect (bool forcefullyMarkAsTerminated=false)=0
 Initiates disconnect of the session. More...
 
virtual void disconnect (const std::string &logoutText, bool forcefullyMarkAsTerminated=false)=0
 Initiates disconnect of the session with the given logout text. More...
 
virtual void disconnectNonGracefully ()=0
 Closes the telecommunication link and switches the session into the NON_GRACEFULLY_TERMINATED state. More...
 
virtual void disconnectSync (bool forcefullyMarkAsTerminated=false)
 Initiates synchronous disconnect of the session. More...
 
virtual void disconnectSync (const std::string &logoutText, bool forcefullyMarkAsTerminated=false)
 Initiates synchronous disconnect of the session with the given logout text. More...
 
virtual ActiveConnection getActiveConnectionType () const =0
 Returns current connection type. More...
 
virtual std::auto_ptr
< SessionExtraParameters
getActiveParameters () const =0
 Returns std::string representation of active session parameters. More...
 
virtual std::auto_ptr
< SessionBackupParameters
getBackupParameters (bool forceLock=true) const =0
 Returns std::string representation of backup session parameters forceLock - if false then try and may give up and return empty data. More...
 
virtual Engine::EncryptMethod getEncryptionMethod () const =0
 Returns the encryption method. More...
 
virtual int getHBI () const =0
 Returns Heartbeat interval (HeartBtInt) in seconds. More...
 
virtual const std::string * getId () const =0
 Returns the session's ID in the format 'SenderCompID 0x01 TargetCompId'. More...
 
virtual int getInSeqNum () const =0
 Returns the incoming sequence numbers for this FIX session (the expected MsgSeqNum of the next incoming message). More...
 
virtual const std::string getMsgStorageBaseFilePath () const =0
 Returns message storage base file path. More...
 
virtual int getOutSeqNum () const =0
 Returns the outgoing sequence numbers for this FIX session (MsgSeqNum of the next outgoing message). More...
 
virtual std::auto_ptr
< SessionExtraParameters
getPrimaryParameters (bool forceLock=true) const =0
 Returns std::string representation of primary session parameters forceLock - if false then try and may give up and return empty data. More...
 
virtual void getReceivedMessages (std::vector< FIXMessage * > *pMessages, const MsgFilter &msgFilter) const =0
 Retrieves messages received by the session. More...
 
virtual const System::InetAddress & getRemoteAddress () const =0
 Returns the remote FIX Engine's IP Address. More...
 
virtual const std::string * getRemoteHost () const =0
 Returns the remote FIX Engine's host name. More...
 
virtual IPAddr getRemoteHostIP () const
 Returns the remote FIX Engine's IP Address. More...
 
virtual int getRemotePort ()=0
 Returns the remote FIX Engine's port number. More...
 
virtual Role getRole () const =0
 Returns session's role. More...
 
virtual const std::string * getSender () const =0
 Returns SenderCompID. More...
 
virtual SessionEx * getSessionEx ()
 Extends session interface. More...
 
virtual System::u64 getSessionGlobalID ()=0
 Returns session global id. More...
 
virtual State getState () const =0
 Returns session's state;. More...
 
virtual const char * getStateAsString ()=0
 Returns current session's state as std::string;. More...
 
virtual MessageStorageType getStorageType () const =0
 Returns a session storage type. More...
 
virtual const std::string * getTarget () const =0
 Returns TargetCompID. More...
 
virtual UnderlyingProtocol getUnderlyingProtocol () const =0
 Returns type of the underlying protocol. More...
 
virtual unsigned getUserSessionKey () const =0
 Returns session user key FIXFields::CMIUserSessionKey obtained in logon. More...
 
virtual FIXVersion getVer () const =0
 Returns the FIX protocol version. More...
 
virtual bool isTCPBuffer () const =0
 Checks if TCP buffer is enabled. More...
 
virtual FIXMessagelocateSentMessage (int seqNum) const =0
 Searches for a message by sequence number in the outgoing storage. More...
 
virtual bool locateSentMessage (int seqNum, std::string &buf) const =0
 Searches for a message by sequence number in the outgoing storage. More...
 
virtual FIXMessagenewSkel (const char *msgType, Engine::FIXVersion app_ver=Engine::NA) const =0
 Creates instance of the message withe same protocol as session is. More...
 
virtual std::size_t outgoingQueueSize () const =0
 Returns size of the outgoing message queue. More...
 
virtual void parse (Parser::LiteFixMessage *msg, const char *ptr, int size, bool clearTheMessageBeforeUse, bool isMakeStandalone, Engine::FIXTagVisitor *callback, bool isIncoming)=0
 Parses input buffer and fills existing LiteFixMessage with tags. More...
 
virtual void ping (const std::string &testReqID="")=0
 Sends Test Request message. More...
 
virtual ProtocolID protocolID () const =0
 Returns unique protocol identifier of the session. More...
 
virtual void put (FIXMessage *pMsg, PutMessageOptions const *options=NULL)=0
 Sends the given message to the remote FIX engine. More...
 
virtual void put (const std::string &msgHeader, const std::string &msgBody)=0
 Sends the given message to the remote FIX engine. More...
 
virtual void put (const void *binaryMessage, size_t binaryMessageSize, PutMessageOptions const *options=NULL)=0
 Sends the given binary message to counter-party. More...
 
virtual ApplicationregisterApplication (Application *pNewApplication, unsigned int delay=300, int maxTries=-1)=0
 Registers Application. More...
 
virtual void resetMessageStorage ()=0
 Reset messages storage, so nothing will be send on ResendRequest. More...
 
virtual void resetSeqNum (SeqNumResetStrategy strategy=RESET_SEQNUM_AND_SEND_LOGON_STRATEGY)=0
 Resets sequence numbers according to chosen strategy. More...
 
virtual void resumeRead ()=0
 Activates reading from the session socket if it was paused. More...
 
virtual void setEnableMessageRejecting (bool enable)=0
 Forcedly sets the value of the Enable Message Rejecting. More...
 
virtual void setForcedReconnect (bool enable)=0
 Forcedly sets the value of the Forced Reconnect. More...
 
virtual void setInSeqNum (int seqNum)=0
 Forcedly sets the value of the incoming sequence number (the expected MsgSeqNum of the next incoming message). More...
 
virtual void setIntradayLogoutToleranceMode (bool enable)=0
 Forcedly sets the value of the Intraday Logout Tolerance Mode. More...
 
virtual void setOutSeqNum (int seqNum)=0
 Forcedly sets the value of the outgoing sequence number (MsgSeqNum of the next outgoing message). More...
 
virtual void setSenderLocationID (const std::string &id)=0
 Forcedly sets the value of the Sender Location ID. More...
 
virtual void setSenderSubID (const std::string &id)=0
 Forcedly sets the value of the Sender Sub ID. More...
 
virtual void setTargetLocationID (const std::string &id)=0
 Forcedly sets the value of the Target Location ID. More...
 
virtual void setTargetSubID (const std::string &id)=0
 Forcedly sets the value of the Target Sub ID. More...
 
virtual bool setTCPBuffer (bool enable)=0
 Enables or disables TCP buffer. More...
 
virtual void switchConnection ()=0
 Switch session to the another connection. More...
 
virtual void syncMessageStorage ()=0
 Flushes storage cache. More...
 
virtual bool waitUntilTerminated (int timeout=-1)=0
 Waits until all internal threads are stopped. More...
 
- Public Member Functions inherited from Utils::ReferenceCounter
virtual bool addRef () const throw ()
 Increments reference counter. More...
 
long decrement () const throw ()
 
virtual long getNRef () const throw ()
 Returns the current value of the reference counter. More...
 
 ReferenceCounter () throw ()
 Constructor. More...
 
virtual long release () const throw ()
 Decrements reference counter. More...
 

Static Public Member Functions

static const char * connState2string (ActiveConnection aState)
 Returns the std::string representation of the given connection state value. More...
 
static const char * messageStorageTypeToString (MessageStorageType value)
 Converts MessageStorageType to string. More...
 
static const char * role2string (SessionRole role)
 Returns the string representation of the given Role value. More...
 
static const char * state2string (State state)
 Returns the string representation of the given state value. More...
 
static MessageStorageType stringToMessageStorageType (char const *value)
 Converts string to MessageStorageType. More...
 

Protected Member Functions

 Session ()
 Constructor. More...
 
virtual ~Session ()
 Destructor. More...
 
- Protected Member Functions inherited from Utils::ReferenceCounter
virtual ~ReferenceCounter ()
 Destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from Utils::ReferenceCounter
volatile System::u32 m_nRef
 The counter. More...
 

Detailed Description

Basic Session.

Member Typedef Documentation

Session role.

Member Enumeration Documentation

Active connection to use.

Enumerator
PRIMARY_CONNECTION 

The session connects via primary connection.

BACKUP_CONNECTION 

The session connects via backup connection.

RESTORE_CONNECTION 

The session connects to the previous active connection.

Sequence numbers reset strategy.

Enumerator
RESET_SEQNUM_STRATEGY 
RESET_SEQNUM_AND_SEND_LOGON_STRATEGY 

Should be used to reset sequence numbers on local side. Strategy covers case when sequence numbers on acceptor and initiator sides are reset at specific time on both sides. It should be used in INITIAL, NON_GRACEFULLY_TERMINATED and CORRECTLY_TERMINATED state.

Strategy to reset sequence using ResetSeqNumFlag flag that indicates both sides of a FIX session should reset sequence numbers.

Warning
cannot be used with FIX40.

Possible states of Session.

See Also
Session::state2string(State state).
Enumerator
ESTABLISHED 

The session is fully established.

INITIAL 

The session has been created, but has not been connected yet.

NON_GRACEFULLY_TERMINATED 

The session has been non-gracefully terminated.

RECONNECT 

The session-initiator has detected the telecommunication link error and is trying to re-establish the link.

CORRECTLY_TERMINATED 

The session has been correctly terminated.

WAIT_FOR_CONFIRM_LOGON 

The session has been connected as an Initiator, the first Logon message has been sent and it is waiting for the conforming Logon message.

WAIT_FOR_CONFIRM_LOGOUT 

Waiting for confirm logout state.

WAIT_FOR_FIRST_LOGON 

The session has been connected as an Acceptor and is waiting for the first Logon message.

SWITCH_CONNECTION 

The session switch to the another connection (backup or primary)

WAIT_FOR_FIRST_HELLO 

The session has been connected as an Acceptor and is waiting for the first Hello message.

WAIT_FOR_CONFIRM_HELLO 

The session has been connected as an Initiator, the first FAST Hello message has been sent and it is waiting for the conforming Hello message.

WAIT_FOR_CONNECT 

The session-initiator is waiting fo async connect to complete.

Constructor & Destructor Documentation

Engine::Session::Session ( )
inlineprotected

Constructor.

virtual Engine::Session::~Session ( )
inlineprotectedvirtual

Destructor.

Note
It is necessary to call the 'release()' method to free the resources used by this session.

Member Function Documentation

virtual void Engine::Session::attachStateObserver ( SessionStateObserver *  observer)
pure virtual
virtual void Engine::Session::closeMessageStorage ( )
pure virtual

Close message storage.

Method forcedly closes storage if session is in the NGT/CT state.

virtual void Engine::Session::commitIncomingMessage ( Engine::FIXMessageProcessElem work) const
pure virtual

Saves incoming message to the session storage if it is not commited yet.

See Also
Application::process( work, sn )
virtual void Engine::Session::connect ( EncryptMethod  encryption = Engine::NONE)
pure virtual

Establishes the FIX session as Acceptor.

Parameters
encryptionEncrypt 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.

Parameters
HBIHeartbeat interval (seconds)
hostremote FIX engine's host name or address.
portremote FIX engine's port.
encryptionEncrypt 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.

Parameters
HBIHeartbeat interval (in seconds)
customLogonMsgthe custom Logon message.
hostremote FIX engine's host name or address.
portremote FIX engine's port.
encryptionEncrypt 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.

Parameters
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.

Parameters
protocolConfig- set of the FIXT11_TCP protocol parameters.
backupConn- parameters of the backup connection
static const char* Engine::Session::connState2string ( ActiveConnection  aState)
static

Returns the std::string representation of the given connection state value.

virtual void Engine::Session::detachStateObserver ( )
pure virtual
virtual void Engine::Session::disconnect ( bool  forcefullyMarkAsTerminated = false)
pure virtual

Initiates disconnect of the session.

Parameters
forcefullyMarkAsTerminatedif true then the session will be marked as correctly terminated and persistant information about it will not be used during the subsequent connections.
Note
the forcefullyMarkAsTerminated parameter is used only if the IntradayLogoutTolerance configuration option is "false".
virtual void Engine::Session::disconnect ( const std::string &  logoutText,
bool  forcefullyMarkAsTerminated = false 
)
pure virtual

Initiates disconnect of the session with the given logout text.

Parameters
forcefullyMarkAsTerminatedif true then the session will be marked as correctly terminated and persistant
logoutTextReason of disconnecting information about it will not be used during the subsequent connections.
Note
the forcefullyMarkAsTerminated parameter is used only if the IntradayLogoutTolerance configuration option is "false".
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::disconnectSync ( bool  forcefullyMarkAsTerminated = false)
virtual

Initiates synchronous disconnect of the session.

Parameters
forcefullyMarkAsTerminatedif true then the session will be marked as correctly terminated and persistant information about it will not be used during the subsequent connections.
Note
the forcefullyMarkAsTerminated parameter is used only if the IntradayLogoutTolerance configuration option is "false".
virtual void Engine::Session::disconnectSync ( const std::string &  logoutText,
bool  forcefullyMarkAsTerminated = false 
)
virtual

Initiates synchronous disconnect of the session with the given logout text.

Parameters
forcefullyMarkAsTerminatedif true then the session will be marked as correctly terminated and persistant
logoutTextReason of disconnecting information about it will not be used during the subsequent connections.
Note
the forcefullyMarkAsTerminated parameter is used only if the IntradayLogoutTolerance configuration option is "false".
virtual ActiveConnection Engine::Session::getActiveConnectionType ( ) const
pure virtual

Returns current connection type.

virtual std::auto_ptr<SessionExtraParameters> Engine::Session::getActiveParameters ( ) const
pure virtual

Returns std::string representation of active session parameters.

Returns
std::string representation of active session parameters or NULL if parameters not exist
virtual std::auto_ptr<SessionBackupParameters> Engine::Session::getBackupParameters ( bool  forceLock = true) const
pure virtual

Returns std::string representation of backup session parameters forceLock - if false then try and may give up and return empty data.

Returns
std::string representation of backup session parameters or NULL if parameters not exist
virtual Engine::EncryptMethod Engine::Session::getEncryptionMethod ( ) const
pure virtual

Returns the encryption method.

virtual int Engine::Session::getHBI ( ) const
pure virtual

Returns Heartbeat interval (HeartBtInt) in seconds.

virtual const std::string* Engine::Session::getId ( ) const
pure virtual

Returns the session's ID in the format 'SenderCompID 0x01 TargetCompId'.

virtual int Engine::Session::getInSeqNum ( ) const
pure virtual

Returns the incoming sequence numbers for this FIX session (the expected MsgSeqNum of the next incoming message).

virtual const std::string Engine::Session::getMsgStorageBaseFilePath ( ) const
pure virtual

Returns message storage base file path.

Base file path is path to the file set without extension.

Returns
Returns message storage base file path
virtual int Engine::Session::getOutSeqNum ( ) const
pure virtual

Returns the outgoing sequence numbers for this FIX session (MsgSeqNum of the next outgoing message).

virtual std::auto_ptr<SessionExtraParameters> Engine::Session::getPrimaryParameters ( bool  forceLock = true) const
pure virtual

Returns std::string representation of primary session parameters forceLock - if false then try and may give up and return empty data.

Returns
std::string representation of primary session parameters or NULL if parameters not exist
virtual void Engine::Session::getReceivedMessages ( std::vector< FIXMessage * > *  pMessages,
const MsgFilter msgFilter 
) const
pure virtual

Retrieves messages received by the session.

Parameters
pMessagesList of messages.
msgFilterspecifies selection criteria.
Warning
It's caller's responsibility to release returned messages.
virtual const System::InetAddress& Engine::Session::getRemoteAddress ( ) const
pure virtual

Returns the remote FIX Engine's IP Address.

Exceptions
Utils::Exceptionif no data is available
virtual const std::string* Engine::Session::getRemoteHost ( ) const
pure virtual

Returns the remote FIX Engine's host name.

Exceptions
Utils::Exceptionif no data is available
virtual IPAddr Engine::Session::getRemoteHostIP ( ) const
virtual

Returns the remote FIX Engine's IP Address.

Exceptions
Utils::Exceptionif no data is available
virtual int Engine::Session::getRemotePort ( )
pure virtual

Returns the remote FIX Engine's port number.

virtual Role Engine::Session::getRole ( ) const
pure virtual

Returns session's role.

virtual const std::string* Engine::Session::getSender ( ) const
pure virtual

Returns SenderCompID.

virtual SessionEx* Engine::Session::getSessionEx ( )
virtual

Extends session interface.

virtual System::u64 Engine::Session::getSessionGlobalID ( )
pure virtual

Returns session global id.

virtual State Engine::Session::getState ( ) const
pure virtual

Returns session's state;.

See Also
Session::state2string(State).
virtual const char* Engine::Session::getStateAsString ( )
pure virtual

Returns current session's state as std::string;.

See Also
Session::getState()
virtual MessageStorageType Engine::Session::getStorageType ( ) const
pure virtual

Returns a session storage type.

virtual const std::string* Engine::Session::getTarget ( ) const
pure virtual

Returns TargetCompID.

virtual UnderlyingProtocol Engine::Session::getUnderlyingProtocol ( ) const
pure virtual

Returns type of the underlying protocol.

virtual unsigned Engine::Session::getUserSessionKey ( ) const
pure virtual

Returns session user key FIXFields::CMIUserSessionKey obtained in logon.

Note
for CMI sessions only.
virtual FIXVersion Engine::Session::getVer ( ) const
pure virtual

Returns the FIX protocol version.

virtual bool Engine::Session::isTCPBuffer ( ) const
pure virtual

Checks if TCP buffer is enabled.

Returns
true, if TCP buffer is enabled.
virtual FIXMessage* Engine::Session::locateSentMessage ( int  seqNum) const
pure virtual

Searches for a message by sequence number in the outgoing storage.

Returns
Pointer to FIXMessage is message was found; NULL otherwise.
virtual bool Engine::Session::locateSentMessage ( int  seqNum,
std::string &  buf 
) const
pure virtual

Searches for a message by sequence number in the outgoing storage.

Parameters
[out]bufresult message
Returns
true if message was found, false otherwise
static const char* Engine::Session::messageStorageTypeToString ( MessageStorageType  value)
static

Converts MessageStorageType to string.

virtual FIXMessage* Engine::Session::newSkel ( const char *  msgType,
Engine::FIXVersion  app_ver = Engine::NA 
) const
pure virtual

Creates instance of the message withe same protocol as session is.

virtual std::size_t Engine::Session::outgoingQueueSize ( ) const
pure virtual

Returns size of the outgoing message queue.

Returns
size of the outgoing message queue.
virtual void Engine::Session::parse ( Parser::LiteFixMessage msg,
const char *  ptr,
int  size,
bool  clearTheMessageBeforeUse,
bool  isMakeStandalone,
Engine::FIXTagVisitor callback,
bool  isIncoming 
)
pure virtual

Parses input buffer and fills existing LiteFixMessage with tags.

Parameters
msgLiteFixMessage to fill
ptrpointer to the buffer
sizebuffer size
clearTheMessageBeforeUseif true message will be cleared before parsing
isMakeStandaloneif true buffer will be copied to the internal storage otherwise links to the passed buffer will be kept
callbackFIXTagVisitor will be called for each parsed tag. Optional.
isIncomingdefines if message is incoming (for non-FIX protocols only)
See Also
LiteFixMessage::parse(message, messageLength, clearTheMessageBeforeUse, makeStandalone, callback)
virtual void Engine::Session::ping ( const std::string &  testReqID = "")
pure virtual

Sends Test Request message.

Parameters
testReqIDThe TestReqID field (tag = 112) - Identifier included in Test Request message to be returned in resulting Heartbeat message. If empty then a timestamp std::string will be used as the value.
virtual ProtocolID Engine::Session::protocolID ( ) const
pure virtual

Returns unique protocol identifier of the session.

virtual void Engine::Session::put ( FIXMessage pMsg,
PutMessageOptions const *  options = NULL 
)
pure virtual

Sends the given message to the remote FIX engine.

Warning
Method throws Utils::Exception in case message is incorrect or session is closed.
virtual void Engine::Session::put ( const std::string &  msgHeader,
const std::string &  msgBody 
)
pure virtual

Sends the given message to the remote FIX engine.

Parameters
msgHeaderthe message header in the native FIX format.
msgBodythe message body in the native FIX format.
Warning
msgHeader and msgBody must be terminated by the FIX delimiter character (0x001).
msgHeader must contain at least the 'BeginString' and 'MsgType' fields.
Method throws Utils::Exception in case message is incorrect or session is closed.
virtual void Engine::Session::put ( const void *  binaryMessage,
size_t  binaryMessageSize,
PutMessageOptions const *  options = NULL 
)
pure virtual

Sends the given binary message to counter-party.

Warning
Method throws Utils::Exception in case message is incorrect, session is closed, session isn't binary or doesn't support direct binary message sending.
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.

Parameters
pNewApplicationInstance 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.
Warning
It is vital to call 'registerApplication(NULL)' before calling the 'release' method.
Returns
a pointer to the old application.
virtual void Engine::Session::resetMessageStorage ( )
pure virtual

Reset messages storage, so nothing will be send on ResendRequest.

Deprecated:
Use Engine::Session::resetSeqNum method
virtual void Engine::Session::resetSeqNum ( SeqNumResetStrategy  strategy = RESET_SEQNUM_AND_SEND_LOGON_STRATEGY)
pure virtual

Resets sequence numbers according to chosen strategy.

See Also
Engine::Session::SeqNumResetStrategy
virtual void Engine::Session::resumeRead ( )
pure virtual

Activates reading from the session socket if it was paused.

static const char* Engine::Session::role2string ( SessionRole  role)
static

Returns the string representation of the given Role value.

virtual void Engine::Session::setEnableMessageRejecting ( bool  enable)
pure virtual

Forcedly sets the value of the Enable Message Rejecting.

virtual void Engine::Session::setForcedReconnect ( bool  enable)
pure virtual

Forcedly sets the value of the Forced Reconnect.

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::setIntradayLogoutToleranceMode ( bool  enable)
pure virtual

Forcedly sets the value of the Intraday Logout Tolerance Mode.

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::setSenderSubID ( const std::string &  id)
pure virtual

Forcedly sets the value of the Sender Sub 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::setTargetSubID ( const std::string &  id)
pure virtual

Forcedly sets the value of the Target Sub ID.

virtual bool Engine::Session::setTCPBuffer ( bool  enable)
pure virtual

Enables or disables TCP buffer.

Parameters
enable- when true, TCP buffer will be enabled.
Returns
true, if TCP buffer was enabled before.
static const char* Engine::Session::state2string ( State  state)
static

Returns the string representation of the given state value.

static MessageStorageType Engine::Session::stringToMessageStorageType ( char const *  value)
static

Converts string to MessageStorageType.

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::syncMessageStorage ( )
pure virtual

Flushes storage cache.

Returns when finished.

virtual bool Engine::Session::waitUntilTerminated ( int  timeout = -1)
pure virtual

Waits until all internal threads are stopped.

Method can be called in the INITIAL, NON_GRACEFULLY_TERMINATED and CORRECTLY_TERMINATED states.

Warning
method is NOT YET IMPLEMENTED.
Returns
true if session is completely terminated; false otherwise.
Warning
This method is not thread safe. Do not call it together with other methods like Session::connect which can change state.