OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
Session Class Reference

Classes

class  MsgBatch
class  MsgBatchHelper
struct  ProxySettings

Public Types

typedef std::pair< unsigned short, unsigned short > LocalPortRange
typedef MsgBatch< MessageMessageBatch
typedef MsgBatch< FlatMessageFlatMessageBatch
typedef FlatMessageBatch SerializedMessageBatch
typedef std::set< std::string > InboundMessageLogFilter
typedef std::set< std::string > OutboundMessageLogFilter
typedef std::vector< TagScrambledFields

Public Member Functions

 Session (const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, ISessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=ONIXS_FIXENGINE_NULLPTR)
 Session (ISessionReactor *reactor, const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, ISessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=ONIXS_FIXENGINE_NULLPTR)
 Session (const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=ONIXS_FIXENGINE_NULLPTR)
 Session (ISessionReactor *reactor, const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=ONIXS_FIXENGINE_NULLPTR)
 Session (const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, const std::string &customSessionKey, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=ONIXS_FIXENGINE_NULLPTR)
 Session (ISessionReactor *reactor, const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, bool keepSequenceNumbersAfterLogout, OnixS::FIX::ISessionListener *listener, const std::string &customSessionKey, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=ONIXS_FIXENGINE_NULLPTR)
 ~Session ()
SessionclearOutboundQueue (bool removeFragmentedPacket=false)
SessionState::Enum state () const
EncryptionMethod::Enum encryptionMethod () const
SessionencryptionMethod (EncryptionMethod::Enum newEncryptionMethod)
int listenPort () const
SessionlistenPort (int listenPort)
std::string localNetworkInterface () const
SessionlocalNetworkInterface (const std::string &localNetworkInterface)
unsigned short localPort () const
LocalPortRange localPortRange () const
SessionlocalPortRange (LocalPortRange portRange)
bool tcpNoDelayOption () const
SessiontcpNoDelayOption (bool improveLatency=true)
bool sendLogoutOnException () const
SessionsendLogoutOnException (bool sendLogoutOnException)
bool validateUnknownMessages () const
SessionvalidateUnknownMessages (bool)
bool validateUnknownFields () const
SessionvalidateUnknownFields (bool)
bool validateRequiredFields () const
SessionvalidateRequiredFields (bool)
bool validateFieldValues () const
SessionvalidateFieldValues (bool)
bool validateEmptyFieldValues () const
SessionvalidateEmptyFieldValues (bool)
bool validateRepeatingGroupEntryCount () const
SessionvalidateRepeatingGroupEntryCount (bool)
bool validateRepeatingGroupLeadingTag () const
SessionvalidateRepeatingGroupLeadingTag (bool)
bool validateDuplicatedField () const
SessionvalidateDuplicatedField (bool)
bool validateChecksum () const
SessionvalidateChecksum (bool)
unsigned messageGrouping () const
SessionmessageGrouping (unsigned numberOfMessagesToGroup)
ThreadingModel::Enum threadingModel () const
SessionthreadingModel (ThreadingModel::Enum value)
bool useSpinLock () const
SessionuseSpinLock (bool value)
int reasonableTransmissionTime () const
SessionreasonableTransmissionTime (int value)
SessionreconnectAttempts (int value)
int reconnectAttempts () const
SessionreconnectInterval (int value)
int reconnectInterval () const
SessionreceiveSpinningTimeoutUsec (int usec)
int receiveSpinningTimeout () const
SessionsendSpinningTimeoutUsec (int usec)
int sendSpinningTimeout () const
SessionsupportNextExpectedMsgSeqNum (bool support)
bool supportNextExpectedMsgSeqNum () const
std::string sslCertificateFile () const
SessionsslCertificateFile (const std::string &file)
std::string sslPrivateKeyFile () const
SessionsslPrivateKeyFile (const std::string &file)
Cryptography::SecureString sslPrivateKeyPassword () const
SessionsslPrivateKeyPassword (const Cryptography::SecureString &password)
SessionsslVerifyPeer (bool verify)
bool sslVerifyPeer () const
SessionsslClientSni (const std::string &hostName)
const std::string & sslClientSni () const
SessionsslCaFile (const std::string &value)
std::string sslCaFile () const
SessionsslMinProtocolVersion (SslProtocolMinMaxVersion::Enum version)
SslProtocolMinMaxVersion::Enum sslMinProtocolVersion () const
SessionsslMaxProtocolVersion (SslProtocolMinMaxVersion::Enum version)
SslProtocolMinMaxVersion::Enum sslMaxProtocolVersion () const
SessionlogonAsAcceptor ()
SessionlogonAsInitiator (const std::string &host, int port, bool setResetSeqNumFlag)
SessionlogonAsInitiator (const std::string &host, int port)
SessionlogonAsInitiator (const std::string &host, int port, int heartbeatIntervalSec)
SessionlogonAsInitiator (const std::string &host, int port, int heartbeatIntervalSec, bool setResetSeqNumFlag)
SessionlogonAsInitiator (const std::string &host, int port, int heartbeatIntervalSec, Message *customLogonMsg)
SessionlogonAsInitiator (const std::string &host, int port, int heartbeatIntervalSec, Message *customLogonMsg, bool setResetSeqNumFlag)
Threading::SharedFuture< void > logonAsInitiatorAsync (const std::string &host, int port, int heartbeatIntervalSec, Message *customLogonMsg, bool setResetSeqNumFlag)
Sessionlogout ()
Sessionlogout (const std::string &text)
Threading::SharedFuture< void > logoutAsync (const std::string &text)
Sessionlogout (Message *customLogoutMessage)
Sessionlogout (FlatMessage *customLogoutMessage)
Threading::SharedFuture< void > logoutAsync (Message *customLogoutMessage)
Threading::SharedFuture< void > logoutAsync (FlatMessage *customLogoutMessage)
SessionbreakConnection ()
Sessionsend (Message *msg)
Sessionsend (FlatMessage *msg)
Sessionsend (FlatMessage *msg, SessionSendMode::Enum mode)
Sessionsend (MessageBatch &msgs, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
Sessionsend (FlatMessageBatch &msgs, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
Sessionsend (FlatMessageBatch &msgs, SessionSendMode::Enum mode, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
SessionsendAsIs (FlatMessage *msg)
SessionsendAsIs (FlatMessageBatch &msgs, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
Sessionthrottle ()
size_t tryThrottle (bool resetWhenDelay=false)
SessionthrottlingLimit (size_t messagesCount, size_t intervalInMs=1000)
SessionwarmUp (FlatMessage *msg, int warmupFlags=0)
void preFill (Message &msg) const
void preFill (FlatMessage &msg) const
void preFill (FlatMessageBatch &msgs) const
Sessionshutdown ()
 operator const std::string & () const
const std::string & storageId () const
SessionflushSessionStorage (bool syncData=false)
std::string counterpartyHost () const
std::string counterpartyIpAddress () const
size_t counterpartyPort () const
const std::string & customKey () const
size_t outboundQueueBytes () const
int heartbeatIntervalSec () const
bool logInboundMessages () const
SessionlogInboundMessages (bool value)
bool logOutboundMessages () const
SessionlogOutboundMessages (bool value)
InboundMessageLogFilter inboundMessageLogFilter () const
SessioninboundMessageLogFilter (const InboundMessageLogFilter &filter)
OutboundMessageLogFilter outboundMessageLogFilter () const
SessionoutboundMessageLogFilter (const OutboundMessageLogFilter &filter)
bool logBeforeSending () const
SessionlogBeforeSending (bool value)
SequenceNumber inSeqNum () const
SessioninSeqNum (SequenceNumber seqNum)
SequenceNumber outSeqNum () const
SessionoutSeqNum (SequenceNumber seqNum)
SessionresendRequestMaximumRange (int range)
int resendRequestMaximumRange () const
SessionresendingQueueSize (size_t value)
size_t resendingQueueSize () const
SessionresendingBatchSize (size_t value)
size_t resendingBatchSize () const
SessionRole::Enum role () const
const std::string & senderCompId () const
bool specifyLastMsgSeqNumProcessed () const
SessionspecifyLastMsgSeqNumProcessed (bool specify)
bool updateSendingTimeField () const
SessionupdateSendingTimeField (bool specify)
SessionsendingTimeFormat (TimestampFormat::Enum format)
const std::string & targetCompId () const
Dictionary dictionary () const
const OnixS::Threading::CpuIndexesreceivingThreadAffinity () const
SessionreceivingThreadAffinity (const OnixS::Threading::CpuIndexes &cpuIndexes)
SessionreceivingThreadAffinity (const OnixS::Threading::CpuIndex cpuIndex)
const OnixS::Threading::CpuIndexessendingThreadAffinity () const
SessionsendingThreadAffinity (const OnixS::Threading::CpuIndexes &cpuIndexes)
SessionsendingThreadAffinity (const OnixS::Threading::CpuIndex cpuIndex)
int receivingThreadPriority () const
SessionreceivingThreadPriority (int priority)
int sendingThreadPriority () const
SessionsendingThreadPriority (int priority)
int receivingThreadPolicy () const
SessionreceivingThreadPolicy (int policy)
int sendingThreadPolicy () const
SessionsendingThreadPolicy (int policy)
MessagefindSentMessage (SequenceNumber messageSequenceNumber)
FlatMessagefindSentFlatMessage (SequenceNumber messageSequenceNumber)
MsgBatchTraits< Message >::MsgBatchType findSentMessages (SequenceNumber beginSequenceNumber, SequenceNumber endSequenceNumber)
MsgBatchTraits< FlatMessage >::MsgBatchType findSentFlatMessages (SequenceNumber beginSequenceNumber, SequenceNumber endSequenceNumber)
SessionreportNewMessagesWhileWaitingForMissedMessages (bool report)
bool reportNewMessagesWhileWaitingForMissedMessages () const
SessionsendResendRequestOnEachMessageGap (bool send)
bool sendResendRequestOnEachMessageGap () const
SessionrequestOnlyMissedMessages (bool request)
bool requestOnlyMissedMessages () const
SessionconsiderRejectOnResendRequestAsGapFill (bool consider)
bool considerRejectOnResendRequestAsGapFill () const
SessionignoreLessThanExpectedSequenceNumber (bool ignore)
bool ignoreLessThanExpectedSequenceNumber () const
SessionresetLocalSequenceNumbersOnLogon (bool reset)
bool resetLocalSequenceNumbersOnLogon () const
SessionincomingMessageGapQueueMaximumSize (size_t maxSize)
size_t incomingMessageGapQueueMaximumSize () const
SessionregisterListener (ISessionListener *listener)
SessionunregisterListener (ISessionListener *listener)
SessionunregisterAllListeners ()
SessionresetLocalSequenceNumbers ()
SessionresetSeqNumViaLogonExchange ()
std::string senderSubId () const
SessionsenderSubId (const std::string &value)
std::string targetSubId () const
SessiontargetSubId (const std::string &value)
std::string senderLocationId () const
SessionsenderLocationId (const std::string &value)
std::string targetLocationId () const
SessiontargetLocationId (const std::string &value)
SessionvalidateSequenceNumbers (bool value)
bool validateSequenceNumbers () const
std::string threadNameSuffix () const
SessionthreadNameSuffix (const std::string &value)
SessionsendTestRequest (const std::string &testReqId="", const TimeSpan &timeout=TimeSpan::zero())
SessionsendResendRequest (SequenceNumber beginSeqNumber)
SessionsendReject (SequenceNumber refSeqNumber, const std::string &text)
Timestamp creationTime () const
std::string toString () const
OnixS::Sockets::Handle socketHandle ()
SessionsocketOptions (const OnixS::Sockets::SocketOptions &options)
SessionlogDirectory (const std::string &value)
const std::string & logDirectory () const
SessionresendTimeout (const TimeSpan &timeout)
TimeSpan resendTimeout () const
SessionscrambleLogonFields (const ScrambledFields &fields)
ScrambledFields scrambleLogonFields () const
SessionsendQueueMaxSize (size_t size)
size_t sendQueueMaxSize () const
SessionconnectTimeout (const TimeSpan &timeout)
TimeSpan connectTimeout () const
int receiveBufferSize () const
SessionreceiveBufferSize (int value)
int sendBufferSize () const
SessionsendBufferSize (int value)
bool enableRxTimestamp () const
SessionenableRxTimestamp (bool value)
void scheduleShrinkToFit ()
SessionproxySettings (const ProxySettings &settings)
ProxySettings proxySettings () const
MessageMode::Enum messageMode () const
void messageMode (MessageMode::Enum mode)

Static Public Member Functions

static bool checkWarmupFlags (int warmupFlags, unsigned short baseListenPort=5000, const std::string &localNetworkInterface="127.0.0.1")

Static Public Attributes

static const unsigned int ResendRequestMaximumRangeNoLimit
static const int UndefinedPriorityAndPolicy
static const OnixS::Sockets::Handle InvalidSocketHandle

Friends

class Engine::Impl

Detailed Description

Definition at line 97 of file Session.h.

Member Typedef Documentation

◆ FlatMessageBatch

Definition at line 904 of file Session.h.

◆ InboundMessageLogFilter

typedef std::set<std::string> InboundMessageLogFilter

Incoming message types to be filtered out from the logs.

Definition at line 1149 of file Session.h.

◆ LocalPortRange

typedef std::pair<unsigned short, unsigned short> LocalPortRange

The local port range type.

Definition at line 299 of file Session.h.

◆ MessageBatch

Definition at line 903 of file Session.h.

◆ OutboundMessageLogFilter

typedef std::set<std::string> OutboundMessageLogFilter

Outgoing message types to be filtered out from the logs.

Definition at line 1168 of file Session.h.

◆ ScrambledFields

typedef std::vector<Tag> ScrambledFields

The collection of scrambled tags.

Definition at line 1747 of file Session.h.

◆ SerializedMessageBatch

Definition at line 905 of file Session.h.

Constructor & Destructor Documentation

◆ Session() [1/6]

Session ( const std::string & senderCompId,
const std::string & targetCompId,
const Dictionary & dictionary,
ISessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
ISessionStorage * storage = ONIXS_FIXENGINE_NULLPTR )

Creates the FIX Session.

Parameters
senderCompIdThe assigned value used to identify the firm sending message (SenderCompID (tag=49) field value in outgoing messages).
targetCompIdThe assigned value used to identify the receiving firm (TargetCompID (tag=56) field value in outgoing messages).
dictionaryThe FIX dictionary to be used by the session.
listenerAn instance of the ISessionListener interface, which will receive and handle miscellaneous Session events.
storageTypeThe session storage type.
storageThe pluggable session storage.

◆ Session() [2/6]

Session ( ISessionReactor * reactor,
const std::string & senderCompId,
const std::string & targetCompId,
const Dictionary & dictionary,
ISessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
ISessionStorage * storage = ONIXS_FIXENGINE_NULLPTR )

Creates the FIX Session.

Parameters
reactorAn instance of an externally managed reactor.
senderCompIdThe assigned value used to identify the firm sending message (SenderCompID (tag=49) field value in outgoing messages).
targetCompIdThe assigned value used to identify the receiving firm (TargetCompID (tag=56) field value in outgoing messages).
dictionaryThe FIX dictionary to be used by the session.
listenerAn instance of the ISessionListener interface, which will receive and handle miscellaneous Session events.
storageTypeThe session storage type.
storageThe pluggable session storage.

◆ Session() [3/6]

Session ( const std::string & senderCompId,
const std::string & targetCompId,
const Dictionary & dictionary,
bool keepSequenceNumbersAfterLogout,
OnixS::FIX::ISessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
ISessionStorage * storage = ONIXS_FIXENGINE_NULLPTR )

Creates the FIX Session.

Parameters
senderCompIdThe assigned value used to identify the firm sending message (SenderCompID (tag=49) field value in outgoing messages).
targetCompIdThe assigned value used to identify the receiving firm (TargetCompID (tag=56) field value in outgoing messages).
dictionaryThe FIX dictionary to be used by the session.
keepSequenceNumbersAfterLogoutThe option to keep sequence numbers after the exchange of Logout (MsgType=5) messages.
listenerAn instance of the ISessionListener interface which will receive and handle miscellaneous Session events.
storageTypeThe session storage type.
storageThe pluggable session storage.

◆ Session() [4/6]

Session ( ISessionReactor * reactor,
const std::string & senderCompId,
const std::string & targetCompId,
const Dictionary & dictionary,
bool keepSequenceNumbersAfterLogout,
OnixS::FIX::ISessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
ISessionStorage * storage = ONIXS_FIXENGINE_NULLPTR )

Creates the FIX Session.

Parameters
reactorAn instance of an externally managed reactor.
senderCompIdThe assigned value used to identify the firm sending message (SenderCompID (tag=49) field value in outgoing messages).
targetCompIdThe assigned value used to identify the receiving firm (TargetCompID (tag=56) field value in outgoing messages).
dictionaryThe FIX dictionary to be used by the session.
keepSequenceNumbersAfterLogoutThe option to keep sequence numbers after the exchange of Logout (MsgType=5) messages.
listenerAn instance of the ISessionListener interface which will receive and handle miscellaneous Session events.
storageTypeThe session storage type.
storageThe pluggable session storage.

◆ Session() [5/6]

Session ( const std::string & senderCompId,
const std::string & targetCompId,
const Dictionary & dictionary,
bool keepSequenceNumbersAfterLogout,
OnixS::FIX::ISessionListener * listener,
const std::string & customSessionKey,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
ISessionStorage * storage = ONIXS_FIXENGINE_NULLPTR )

Creates the FIX Session.

Parameters
senderCompIdThe assigned value used to identify the firm sending message (SenderCompID (tag=49) field value in outgoing messages).
targetCompIdThe assigned value used to identify the receiving firm (TargetCompID (tag=56) field value in outgoing messages).
dictionaryThe FIX dictionary to be used by the session.
keepSequenceNumbersAfterLogoutThe option to keep sequence numbers after the exchange of Logout (MsgType=5) messages.
listenerAn instance of the ISessionListener interface which will receive and handle miscellaneous Session events.
customSessionKeyThe custom key that can be used to distinguish sessions with the same values of the SenderCompID, TargetCompID and the FIX Protocol version.
storageTypeThe session storage type.
storageThe pluggable session storage.

◆ Session() [6/6]

Session ( ISessionReactor * reactor,
const std::string & senderCompId,
const std::string & targetCompId,
const Dictionary & dictionary,
bool keepSequenceNumbersAfterLogout,
OnixS::FIX::ISessionListener * listener,
const std::string & customSessionKey,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
ISessionStorage * storage = ONIXS_FIXENGINE_NULLPTR )

Creates the FIX Session.

Parameters
reactorAn instance of an externally managed reactor.
senderCompIdThe assigned value used to identify the firm sending message (SenderCompID (tag=49) field value in outgoing messages).
targetCompIdThe assigned value used to identify the receiving firm (TargetCompID (tag=56) field value in outgoing messages).
dictionaryThe FIX dictionary to be used by the session.
keepSequenceNumbersAfterLogoutThe option to keep sequence numbers after the exchange of Logout (MsgType=5) messages.
listenerAn instance of the ISessionListener interface which will receive and handle miscellaneous Session events.
customSessionKeyThe custom key that can be used to distinguish sessions with the same values of the SenderCompID, TargetCompID and the FIX Protocol version.
storageTypeThe session storage type.
storageThe pluggable Session storage.

◆ ~Session()

~Session ( )

The destructor.

Member Function Documentation

◆ breakConnection()

Session & breakConnection ( )

Terminates the FIX connection in the non-graceful way (without the exchange of Logout (MsgType=5) messages).

Note
This call is thread-safe.

◆ checkWarmupFlags()

bool checkWarmupFlags ( int warmupFlags,
unsigned short baseListenPort = 5000,
const std::string & localNetworkInterface = "127.0.0.1" )
static

Returns 'true' if the given flags work as expected and a real data is not sent to the wire, otherwise - 'false'.

Parameters
warmupFlagsWarmup flags for checking.
baseListenPortThe base listen port to use during the checking.
localNetworkInterfaceThe IP address to bind for listen and outgoing test sockets.
Note
This call is thread-safe.

◆ clearOutboundQueue()

Session & clearOutboundQueue ( bool removeFragmentedPacket = false)

Removes all messages from the outbound queue.

Parameters
removeFragmentedPacketThe flag specifies whether to remove the last packet which is partially sent.
Note
This call is thread-safe.

◆ connectTimeout() [1/2]

TimeSpan connectTimeout ( ) const

Returns the socket TCP connect timeout (30 sec by default).

Note
This call is thread-safe.

◆ connectTimeout() [2/2]

Session & connectTimeout ( const TimeSpan & timeout)

Sets the socket TCP connect timeout.

Note
This call is thread-safe.

◆ considerRejectOnResendRequestAsGapFill() [1/2]

bool considerRejectOnResendRequestAsGapFill ( ) const

Returns 'true' if the "Reject" on the "Resend Request" is considered as the "Sequence Reset Gap Fill" message, otherwise - 'false'.

◆ considerRejectOnResendRequestAsGapFill() [2/2]

Session & considerRejectOnResendRequestAsGapFill ( bool consider)

By default, if the "Session Level Reject" message is received in replay to the "Resend Request" then this is considered as a serious problem and the FIX connection will be closed.

This property allows to change this behavior and consider the "Session Level Reject" on the "Resend Request" as the "Sequence Reset Gap Fill" message.

◆ counterpartyHost()

std::string counterpartyHost ( ) const

Returns the counterparty host name.

Note
The method performs a DNS request for the first time. Therefore, it can block the thread execution for a long time until the DNS request is completed.
This call is thread-safe.

◆ counterpartyIpAddress()

std::string counterpartyIpAddress ( ) const

Returns the counterparty address.

Note
This call is thread-safe.

◆ counterpartyPort()

size_t counterpartyPort ( ) const

Returns the counterparty port number.

Note
This call is thread-safe.

◆ creationTime()

Timestamp creationTime ( ) const

Returns the time when logical session was created or the last sequence number reset operation was performed.

The originating value is extracted from the attached storage using the ISessionStorage::sessionCreationTime() method.

Note
This call is thread-safe.

◆ customKey()

const std::string & customKey ( ) const

Returns the Session's Custom Key.

Note
This call is thread-safe.

◆ dictionary()

Dictionary dictionary ( ) const

The instance of the FIX dictionary or standard FIX messages dictionary which is used by the session.

◆ enableRxTimestamp() [1/2]

bool enableRxTimestamp ( ) const

Returns the value of the option to enable received data timestamp.

The default value is false.

Note
This call is thread-safe.

◆ enableRxTimestamp() [2/2]

Session & enableRxTimestamp ( bool value)

Sets the value of the option to enable received data timestamp.

Note
Available on Linux only.
This call is thread-safe.

◆ encryptionMethod() [1/2]

EncryptionMethod::Enum encryptionMethod ( ) const

Returns the current encryption method.

Note
This call is thread-safe.

◆ encryptionMethod() [2/2]

Session & encryptionMethod ( EncryptionMethod::Enum newEncryptionMethod)

Sets the encryption method.

Note
This call is thread-safe.

◆ findSentFlatMessage()

FlatMessage * findSentFlatMessage ( SequenceNumber messageSequenceNumber)

◆ findSentFlatMessages()

MsgBatchTraits< FlatMessage >::MsgBatchType findSentFlatMessages ( SequenceNumber beginSequenceNumber,
SequenceNumber endSequenceNumber )

◆ findSentMessage()

Message * findSentMessage ( SequenceNumber messageSequenceNumber)

Returns the sent message if it can be found by the given message sequence number, otherwise - NULL.

Note
The returned message is owned by the application and should be released after usage.
This call is thread-safe.

◆ findSentMessages()

MsgBatchTraits< Message >::MsgBatchType findSentMessages ( SequenceNumber beginSequenceNumber,
SequenceNumber endSequenceNumber )

Returns an array of sent messages if it can be found by the given message sequence number range, otherwise - empty array.

Note
The returned messages are owned by the application and should be released after usage.
This call is thread-safe.

◆ flushSessionStorage()

Session & flushSessionStorage ( bool syncData = false)

Flushes all internal buffers of the underlying storage.

Parameters
syncDataWhen it is true, the method will synchronize a file's state with the storage device. On Linux it will call 'fsync()', on Windows '_commit()' functions.
Note
This call is thread-safe.

◆ heartbeatIntervalSec()

int heartbeatIntervalSec ( ) const

Returns the Heartbeat interval (in seconds).

◆ ignoreLessThanExpectedSequenceNumber() [1/2]

bool ignoreLessThanExpectedSequenceNumber ( ) const

Returns 'true' if the sequence number of the incoming message, which less than expected, is considered as an expected one, otherwise - 'false'.

◆ ignoreLessThanExpectedSequenceNumber() [2/2]

Session & ignoreLessThanExpectedSequenceNumber ( bool ignore)

By default, if the incoming message has a sequence number less than expected and the PossDupFlag is not set, it indicates a serious error and leads to FIX connection closing.

This property allows to change this behavior and consider the sequence number of the incoming message, which less than expected, as an expected one.

◆ inboundMessageLogFilter() [1/2]

InboundMessageLogFilter inboundMessageLogFilter ( ) const

Returns incoming message types to be filtered out from the logs.

Note
This call is thread-safe.

◆ inboundMessageLogFilter() [2/2]

Session & inboundMessageLogFilter ( const InboundMessageLogFilter & filter)

Sets incoming message types to be filtered out from the logs.

Note
This call is thread-safe.

◆ incomingMessageGapQueueMaximumSize() [1/2]

size_t incomingMessageGapQueueMaximumSize ( ) const

Returns the maximum size of the incoming message gap queue.

By default, the value equal to 1000.

◆ incomingMessageGapQueueMaximumSize() [2/2]

Session & incomingMessageGapQueueMaximumSize ( size_t maxSize)

If the requestOnlyMissedMessages option is true and the sequence number of an incoming FIX message greater that expected then the resend functionality is run and this incoming message is stored in the incoming message gap queue for further processing.

This property allows to set maximum size of that queue.

◆ inSeqNum() [1/2]

SequenceNumber inSeqNum ( ) const

Returns the expected sequence number of the next incoming message.

Note
This call is thread-safe.

◆ inSeqNum() [2/2]

Session & inSeqNum ( SequenceNumber seqNum)

Sets the expected sequence number of the next incoming message.

Note
This call is thread-safe.

◆ listenPort() [1/2]

int listenPort ( ) const

Returns the port to listen on for incoming FIX Connections in the Acceptor mode.

Note
This call is thread-safe.

◆ listenPort() [2/2]

Session & listenPort ( int listenPort)

Sets the port to listen on for incoming FIX Connections in the Acceptor mode.

Note
This call is thread-safe.

◆ localNetworkInterface() [1/2]

std::string localNetworkInterface ( ) const

Returns the local network interface from which you intend to send and receive data.

Note
This call is thread-safe.

◆ localNetworkInterface() [2/2]

Session & localNetworkInterface ( const std::string & localNetworkInterface)

Sets the local network interface from which you intend to send and receive data.

Note
This call is thread-safe.

◆ localPort()

unsigned short localPort ( ) const

Returns the local port from which you intend to send and receive data.

Note
This call is thread-safe.

◆ localPortRange() [1/2]

LocalPortRange localPortRange ( ) const

Returns the local port range, the first available port from this range will be used to send and receive data.

Note
This call is thread-safe.

◆ localPortRange() [2/2]

Session & localPortRange ( LocalPortRange portRange)

Sets the local port range, the first available port from this range will be used to send and receive data.

Note
This call is thread-safe.

◆ logBeforeSending() [1/2]

bool logBeforeSending ( ) const

Returns 'true' if outbound messages are logged before sending, otherwise - 'false'.

By default, the value is 'true'.

Note
This call is thread-safe.

◆ logBeforeSending() [2/2]

Session & logBeforeSending ( bool value)

The option to switch on/off the logging of outbound messages before/after sending.

Note
This call is thread-safe.

◆ logDirectory() [1/2]

const std::string & logDirectory ( ) const

Inbound and outbound messages, the session's state data are stored in this directory.

Note
This call is thread-safe.

◆ logDirectory() [2/2]

Session & logDirectory ( const std::string & value)

Inbound and outbound messages, the session's state data are stored in this directory.

Note
This method can be called only when the session is disconnected.
Exceptions
Anexception if the session state is not Disconnected.
Note
This call is thread-safe.

◆ logInboundMessages() [1/2]

bool logInboundMessages ( ) const

Returns 'true' if inbound messages are logged, otherwise - 'false'.

By default, the value is 'true'.

◆ logInboundMessages() [2/2]

Session & logInboundMessages ( bool value)

The option to log inbound messages.

◆ logonAsAcceptor()

Session & logonAsAcceptor ( )

Establishes the FIX Connection as an Acceptor.

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

Note
This call is thread-safe.

◆ logonAsInitiator() [1/6]

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

Establishes the FIX Connection as an Initiator.

The Initiator establishes the telecommunications link and initiates the session via the transmission of the initial Logon message. The method is blocked until the acknowledgment Logon message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval.

Note
This call is thread-safe.

◆ logonAsInitiator() [2/6]

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

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

The Initiator establishes the telecommunications link and initiates the session via the transmission of the initial Logon message. The method is blocked until the acknowledgment Logon message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval.

Note
This call is thread-safe.

◆ logonAsInitiator() [3/6]

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

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

The method is blocked until the acknowledgment Logon message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval.

Note
This call is thread-safe.

◆ logonAsInitiator() [4/6]

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

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

The method is blocked until the acknowledgment Logon message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval.

Note
This call is thread-safe.

◆ logonAsInitiator() [5/6]

Session & logonAsInitiator ( const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg )

Establishes the FIX Connection as an Initiator using the custom Logon message.

The method is blocked until the acknowledgment Logon message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval.

Note
This call is thread-safe.

◆ logonAsInitiator() [6/6]

Session & logonAsInitiator ( const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg,
bool setResetSeqNumFlag )

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

The method is blocked until the acknowledgment Logon message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval.

Note
This call is thread-safe.

◆ logonAsInitiatorAsync()

Threading::SharedFuture< void > logonAsInitiatorAsync ( const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg,
bool setResetSeqNumFlag )

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

The method returns immediately without waiting the acknowledgment Logon message. Returns the SharedFuture object that can be used to wait for the result of the asynchronous logon method.

Note
This call is thread-safe.

◆ logout() [1/4]

Session & logout ( )

Terminates the FIX Connection.

The initial Logout message is sent to the counterparty and the method is blocked until the acknowledgment Logout message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval or, in case there are no incoming messages, heartbeat interval plus reasonable transmission time.

Note
This call is thread-safe.

◆ logout() [2/4]

Session & logout ( const std::string & text)

Terminates the FIX Connection.

The initial Logout message is sent to the counterparty and the method is blocked until the acknowledgment Logout message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval or, in case there are no incoming messages, heartbeat interval plus reasonable transmission time.

Parameters
textFree format text string that is sent to the counterparty in the Text(58) field of the initial Logout message.
Note
This call is thread-safe.

◆ logout() [3/4]

Session & logout ( FlatMessage * customLogoutMessage)

◆ logout() [4/4]

Session & logout ( Message * customLogoutMessage)

Terminates the FIX Connection.

The initial Logout message is sent to the counterparty and the method is blocked until the acknowledgment Logout message is received or the timeout expired. The timeout value is equal to the triple heartbeat interval or, in case there are no incoming messages, the heartbeat interval plus reasonable transmission time.

Parameters
customLogoutMessageThe custom Logout message that is sent to the counterparty.
Note
This call is thread-safe.

◆ logoutAsync() [1/3]

Threading::SharedFuture< void > logoutAsync ( const std::string & text)

Terminates the FIX Connection.

The initial Logout message is sent to the counterparty and the method returns immediately without waiting for the acknowledgment Logout message. Returns the SharedFuture object that can be used to wait for the result of the asynchronous logout method.

Parameters
textThe free format text string that is sent to the counterparty in the Text(58) field of the initial Logout message.
Note
This call is thread-safe.

◆ logoutAsync() [2/3]

Threading::SharedFuture< void > logoutAsync ( FlatMessage * customLogoutMessage)

◆ logoutAsync() [3/3]

Threading::SharedFuture< void > logoutAsync ( Message * customLogoutMessage)

Terminates the FIX Connection.

The initial Logout message is sent to the counterparty and the method returns immediately without waiting the acknowledgment Logout message. Returns the SharedFuture object that can be used to wait for the result of the asynchronous logout method.

Parameters
customLogoutMessageThe custom Logout message that is sent to the counterparty.
Note
This call is thread-safe.

◆ logOutboundMessages() [1/2]

bool logOutboundMessages ( ) const

Returns 'true' if outbound messages are logged, otherwise - 'false'.

By default, the value is 'true'.

◆ logOutboundMessages() [2/2]

Session & logOutboundMessages ( bool value)

The option to log outbound messages.

◆ messageGrouping() [1/2]

unsigned messageGrouping ( ) const

Returns the number of messages that should be written to the outgoing TCP buffer together.

When it is not set, the corresponding Engine setting's value is used (0 by default).

◆ messageGrouping() [2/2]

Session & messageGrouping ( unsigned numberOfMessagesToGroup)

Sets the number of messages that should be written to the outgoing TCP buffer together.

◆ messageMode() [1/2]

MessageMode::Enum messageMode ( ) const

Returns the session message mode.

◆ messageMode() [2/2]

void messageMode ( MessageMode::Enum mode)

Sets the session message mode.

◆ operator const std::string &()

operator const std::string & ( ) const

Returns the text description of this session.

Note
This call is thread-safe.

◆ outboundMessageLogFilter() [1/2]

OutboundMessageLogFilter outboundMessageLogFilter ( ) const

Returns outgoing message types to be filtered out from the logs.

Note
This call is thread-safe.

◆ outboundMessageLogFilter() [2/2]

Session & outboundMessageLogFilter ( const OutboundMessageLogFilter & filter)

Sets outgoing message types to be filtered out from the logs.

Note
This call is thread-safe.

◆ outboundQueueBytes()

size_t outboundQueueBytes ( ) const

Returns the total number of bytes in the outbound queue.

Note
This call is thread-safe.

◆ outSeqNum() [1/2]

SequenceNumber outSeqNum ( ) const

Returns the sequence number of the next outgoing message.

Note
This call is thread-safe.

◆ outSeqNum() [2/2]

Session & outSeqNum ( SequenceNumber seqNum)

Sets the sequence number of the next outgoing message.

Note
This call is thread-safe.

◆ preFill() [1/3]

void preFill ( FlatMessage & msg) const

Pre-fills the following fields in the message or messages batch for sending as is:

  • Session-level fields that are constant during the session's lifetime - SenderCompId, TargetCompId, SenderLocationId, TargetLocationI, SenderSubID, TargetSubID.
  • The MsgSeqNum field in accordance with the session outgoing sequence number.
  • The SendingTime field.
  • BodyLength and CheckSum fields.
Note
This call is thread-safe.

◆ preFill() [2/3]

void preFill ( FlatMessageBatch & msgs) const

◆ preFill() [3/3]

void preFill ( Message & msg) const

Pre-fills session-level fields that are constant during the session's lifetime - SenderCompId, TargetCompId, SenderLocationId, TargetLocationID, SenderSubID, TargetSubID.

Note
This call is thread-safe.

◆ proxySettings() [1/2]

ProxySettings proxySettings ( ) const

Returns HTTP proxy settings.

◆ proxySettings() [2/2]

Session & proxySettings ( const ProxySettings & settings)

Sets HTTP proxy settings.

◆ reasonableTransmissionTime() [1/2]

int reasonableTransmissionTime ( ) const

Returns the reasonable transmission time as % from the heartbeatIntervalSec value.

When it is not set, the corresponding Engine setting's value is used (20% by default).

◆ reasonableTransmissionTime() [2/2]

Session & reasonableTransmissionTime ( int value)

Sets the reasonable transmission time as % from the heartbeatIntervalSec value.

When either end of the connection has not received any data for (heartbeatIntervalSec() * (100 + reasonableTransmissionTime())/100) seconds, it will transmit a Test Request message.

If there is still no a Heartbeat message received after (heartbeatIntervalSec * (100 + reasonableTransmissionTime())/100) seconds then the connection should be considered lost and a corrective action be initiated.

◆ receiveBufferSize() [1/2]

int receiveBufferSize ( ) const

Returns the size of the TCP buffer allocated to the FIX connection for receiving data.

If '-1' then the default operating system value is used.

Note
This call is thread-safe.

◆ receiveBufferSize() [2/2]

Session & receiveBufferSize ( int value)

Sets the size of the TCP buffer allocated to the FIX connection for the receiving data.

If '-1' then the default operating system value is used.

Note
This call is thread-safe.

◆ receiveSpinningTimeout()

int receiveSpinningTimeout ( ) const

Returns the current receive spinning timeout value (in microseconds).

By default, the value is zero and the receive spinning is not used.

◆ receiveSpinningTimeoutUsec()

Session & receiveSpinningTimeoutUsec ( int usec)

Sets the non-blocking receive spinning timeout (in microseconds) before the receiving thread enters into the blocking wait mode.

Note
Should not be greater than 1 sec (minimal heartbeatIntervalSec()).

◆ receivingThreadAffinity() [1/3]

const OnixS::Threading::CpuIndexes & receivingThreadAffinity ( ) const

Returns the CPU affinity of the receiving thread.

◆ receivingThreadAffinity() [2/3]

Session & receivingThreadAffinity ( const OnixS::Threading::CpuIndex cpuIndex)

Sets the CPU affinity of the receiving thread to a CPU.

◆ receivingThreadAffinity() [3/3]

Session & receivingThreadAffinity ( const OnixS::Threading::CpuIndexes & cpuIndexes)

Sets the CPU affinity of the receiving thread.

◆ receivingThreadPolicy() [1/2]

int receivingThreadPolicy ( ) const

Returns the scheduling policy of the receiving thread.

◆ receivingThreadPolicy() [2/2]

Session & receivingThreadPolicy ( int policy)

Sets the scheduling policy of the receiving thread.

◆ receivingThreadPriority() [1/2]

int receivingThreadPriority ( ) const

Returns the priority of the receiving thread.

◆ receivingThreadPriority() [2/2]

Session & receivingThreadPriority ( int priority)

Sets the priority of the receiving thread.

◆ reconnectAttempts() [1/2]

int reconnectAttempts ( ) const

Returns the number of attempts to restore the FIX connection.

When it is not set, the corresponding Engine setting's value is used (3 by default).

◆ reconnectAttempts() [2/2]

Session & reconnectAttempts ( int value)

Sets the number of attempts to restore the FIX connection.

◆ reconnectInterval() [1/2]

int reconnectInterval ( ) const

Returns the time interval between the attempts to restore the FIX connection (in seconds).

When it is not set, the corresponding Engine setting's value is used (180 by default).

◆ reconnectInterval() [2/2]

Session & reconnectInterval ( int value)

Sets the time interval between the attempts to restore the FIX connection (in seconds).

◆ registerListener()

Session & registerListener ( ISessionListener * listener)

Registers the Session listener.

Exceptions
Anexception if the listener is already registered.

◆ reportNewMessagesWhileWaitingForMissedMessages() [1/2]

bool reportNewMessagesWhileWaitingForMissedMessages ( ) const

Returns 'true' if the new messages are reported even when the message gap is detected and the reply on the "Resend Request" message is expected, otherwise - 'false'.

◆ reportNewMessagesWhileWaitingForMissedMessages() [2/2]

Session & reportNewMessagesWhileWaitingForMissedMessages ( bool report)

When the message gap is detected the "Resend Request" FIX Message is sent and the Session state is changed to "AwaitReplyOnResendRequest".

By default, in this state the incoming new messages (without the PossDupFlag (tag #43) flag) are ignored because we expect them to be re-sent later again with the PossDupFlag flag.

This property allows to change this behavior and report the new messages anyway.

Note
In this mode, messages could be reported out of the original order: e.g. MsgSeqNum could be: 3 (original), 4 (original), 2 (PossDupFlag='Y'), 3 (PossDupFlag='Y'), 4 (PossDupFlag='Y') and some messages could be received two times: first time without PossDupFlag='Y' and second time - with this flag.

◆ requestOnlyMissedMessages() [1/2]

bool requestOnlyMissedMessages ( ) const

Returns 'true' if the "Resend Request" message requests only missed messages, otherwise - 'false'.

◆ requestOnlyMissedMessages() [2/2]

Session & requestOnlyMissedMessages ( bool request)

By default, the "Resend Request" message requests all messages begin from the first missed one.

This property allows to change this behavior and request only missed messages.

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

◆ resendingBatchSize() [1/2]

size_t resendingBatchSize ( ) const

Returns the maximum number of messages sent in reply to the Resend Request <2> before temporarily releasing the Session’s lock.

Note
This call is thread-safe.

◆ resendingBatchSize() [2/2]

Session & resendingBatchSize ( size_t value)

Sets the maximum number of messages sent in reply to the Resend Request <2> before temporarily releasing the Session’s lock.

Note
This call is thread-safe.

◆ resendingQueueSize() [1/2]

size_t resendingQueueSize ( ) const

Returns the number of sent messages that are available for resending on the counterparty's Resend Request <2> message.

By default, the value is -1 that means that the corresponding Engine setting's value is used ('1000' by default).

Note
This call is thread-safe.

◆ resendingQueueSize() [2/2]

Session & resendingQueueSize ( size_t value)

Sets the number of sent messages that are available for resending on the counterparty's Resend Request <2> message.

Note
This call is thread-safe.

◆ resendRequestMaximumRange() [1/2]

int resendRequestMaximumRange ( ) const

Returns the maximum number of messages to be requested in one Resend Request (MsgType=2) message.

By default, the value is zero (no limit).

See also
Session::ResendRequestMaximumRangeNoLimit.
Note
This call is thread-safe.

◆ resendRequestMaximumRange() [2/2]

Session & resendRequestMaximumRange ( int range)

Sets the maximum number of messages to be requested in one Resend Request (MsgType=2) message.

See also
Session::ResendRequestMaximumRangeNoLimit.
Parameters
rangeThe maximum number of messages to be requested in one Resend Request (MsgType=2) message. Cannot be negative.
Note
This call is thread-safe.

◆ resendTimeout() [1/2]

TimeSpan resendTimeout ( ) const

Returns the timeout during which the counterparty should send a reply to the "Resend Request" message.

Note
This call is thread-safe.

◆ resendTimeout() [2/2]

Session & resendTimeout ( const TimeSpan & timeout)

Sets the timeout during which counterparty should send a reply to the "Resend Request" message.

If a counterparty does not reply or reply incorrectly during this timeout, then the ISessionListener::onWarning is called. By default, the resend request timeout equal to zero, which means an infinite timeout.

Note
The resend timeout is checked when an incoming message is received or when the receive timeout is elapsed. Therefore, the actual timeout can be greater than the specified one or can be rounded to the value equal to the heartbeat interval + reasonable transmission time.
This call is thread-safe.

◆ resetLocalSequenceNumbers()

Session & resetLocalSequenceNumbers ( )

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

Note
This method can be called only when the session is disconnected.
This call is thread-safe.

◆ resetLocalSequenceNumbersOnLogon() [1/2]

bool resetLocalSequenceNumbersOnLogon ( ) const

Returns 'true' if local sequence numbers are reset automatically to 1 during every logon, otherwise - 'false'.

◆ resetLocalSequenceNumbersOnLogon() [2/2]

Session & resetLocalSequenceNumbersOnLogon ( bool reset)

The option to automatically reset the local sequence numbers to 1 during every logon.

◆ resetSeqNumViaLogonExchange()

Session & resetSeqNumViaLogonExchange ( )

Sends a Logon message with the ResetSeqNumFlag set.

Note
This call is thread-safe.

◆ role()

SessionRole::Enum role ( ) const

Returns the session role.

Note
This call is thread-safe.

◆ scheduleShrinkToFit()

void scheduleShrinkToFit ( )

Schedule the memory usage optimization.

The session will perform the actual memory usage optimization in two phases:

  • After receiving and processing the next incoming session-level message (receiving part).
  • Before sending the next outgoing session-level message (sending part).

◆ scrambleLogonFields() [1/2]

ScrambledFields scrambleLogonFields ( ) const

Returns scrambled fields in the Logon(A) message.

◆ scrambleLogonFields() [2/2]

Session & scrambleLogonFields ( const ScrambledFields & fields)

Sets scrambled fields in the Logon(A) message, in the session storage, for security reasons.

Note
This call is thread-safe.

◆ send() [1/6]

Session & send ( FlatMessage * msg)

◆ send() [2/6]

Session & send ( FlatMessage * msg,
SessionSendMode::Enum mode )

Performs sending via a specific API (e.g.

zero-copy send) of 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 are stored in the session storage and will be sent in replay to the resend request when the connection is established with the counterparty and the sequence numbers mismatch is detected.

Note
This call is asynchronous.
This call is thread-safe.

◆ send() [3/6]

Session & send ( FlatMessageBatch & msgs,
SessionSendMode::Enum mode,
size_t maxPacketSize = (std::numeric_limits< size_t >::max)() )

Performs sending via a specific API (e.g.

zero-copy send) of messages 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 are stored in the session storage and will be sent in replay to the resend request when the connection is established with the counterparty and the sequence numbers mismatch is detected.

Note
This call is asynchronous.
This call is thread-safe.

◆ send() [4/6]

Session & send ( FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits< size_t >::max)() )

◆ send() [5/6]

Session & 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 are stored in the session storage and will be sent in replay to the resend request when the connection is established with the counterparty and the sequence numbers mismatch is detected.

Note
This call is asynchronous.
This call is thread-safe.

◆ send() [6/6]

Session & send ( MessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits< size_t >::max)() )

Sends messages in a batch 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 are stored in the session storage and will be sent in replay to the resend request when the connection is established with the counterparty and the sequence numbers mismatch is detected.

Parameters
msgsThe message batch to send.
maxPacketSizeThe maximum number of bytes written to the socket's send buffer together. This parameter could be used to reduce the probability that the operating system will fragment a FIX message across multiple TCP packets.
Note
The message batch should not be empty and the maxPacketSize parameter should not be less than any message size in the batch. Otherwise, the method call can produce an error and the session can close the connection.
This call is asynchronous.
This call is thread-safe.

◆ sendAsIs() [1/2]

Session & sendAsIs ( FlatMessage * msg)

Sends a serialized message(s) to the counterparty without any fields updating.

One can use the preFill method to prepare a message(s) for sending.

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 are stored in the session storage and will be sent in replay to the resend request when the connection is established with the counterparty and the sequence numbers mismatch is detected.

Note
It checks the validity of the sequence number of the provided message. If the sequence number is incorrect, the sequence number, message length, and checksum will be updated during sending.
This call is asynchronous.
This call is thread-safe.

◆ sendAsIs() [2/2]

Session & sendAsIs ( FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits< size_t >::max)() )

Sends a serialized message(s) to the counterparty without any fields updating.

One can use the preFill method to prepare a message(s) for sending.

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 are stored in the session storage and will be sent in replay to the resend request when the connection is established with the counterparty and the sequence numbers mismatch is detected.

Parameters
msgsThe message batch to send.
maxPacketSizeThe maximum number of bytes written to the socket's send buffer together. This parameter could be used to reduce the probability that the operating system will fragment a FIX message across multiple TCP packets.
Note
The message batch should not be empty and the maxPacketSize parameter should not be less than any message size in the batch. Otherwise, the method call can produce an error and the session can close the connection.
It checks the validity of the sequence number of the provided messages. If the sequence number is incorrect, the sequence number, message length, and checksum will be updated during sending.
This call is asynchronous.
This call is thread-safe.

◆ sendBufferSize() [1/2]

int sendBufferSize ( ) const

Returns the size of the TCP buffer allocated to the FIX connection for the sending data.

If '-1' then the default operating system value is used.

Note
This call is thread-safe.

◆ sendBufferSize() [2/2]

Session & sendBufferSize ( int value)

Sets the size of the TCP buffer allocated to the FIX connection for the sending data.

If '-1' then the default operating system value is used.

Note
This call is thread-safe.

◆ senderCompId()

const std::string & senderCompId ( ) const

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

Note
This call is thread-safe.

◆ senderLocationId() [1/2]

std::string senderLocationId ( ) const

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

Note
This call is thread-safe.

◆ senderLocationId() [2/2]

Session & senderLocationId ( const std::string & value)

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

Note
This call is thread-safe.

◆ senderSubId() [1/2]

std::string senderSubId ( ) const

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

Note
This call is thread-safe.

◆ senderSubId() [2/2]

Session & senderSubId ( const std::string & value)

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

Note
This call is thread-safe.

◆ sendingThreadAffinity() [1/3]

const OnixS::Threading::CpuIndexes & sendingThreadAffinity ( ) const

Returns the CPU affinity of the sending thread.

◆ sendingThreadAffinity() [2/3]

Session & sendingThreadAffinity ( const OnixS::Threading::CpuIndex cpuIndex)

Sets the CPU affinity index of the sending thread a CPU.

◆ sendingThreadAffinity() [3/3]

Session & sendingThreadAffinity ( const OnixS::Threading::CpuIndexes & cpuIndexes)

Sets the CPU affinity index of the sending thread.

◆ sendingThreadPolicy() [1/2]

int sendingThreadPolicy ( ) const

Returns the scheduling policy of the sending thread.

◆ sendingThreadPolicy() [2/2]

Session & sendingThreadPolicy ( int policy)

Sets the scheduling policy of the sending thread.

◆ sendingThreadPriority() [1/2]

int sendingThreadPriority ( ) const

Returns the priority of the sending thread.

◆ sendingThreadPriority() [2/2]

Session & sendingThreadPriority ( int priority)

Sets the priority of the sending thread.

◆ sendingTimeFormat()

Session & sendingTimeFormat ( TimestampFormat::Enum format)

Sets the time format of the SendingTime of every sent message.

By default, the YYYYMMDDHHMMSSMsec format is used.

◆ sendLogoutOnException() [1/2]

bool sendLogoutOnException ( ) const

Returns the option that controls whether to send the logout message before dropping the telecommunication link, in case of an exception.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ sendLogoutOnException() [2/2]

Session & sendLogoutOnException ( bool sendLogoutOnException)

Sets the value of the option that controls whether to send the logout message before dropping the telecommunication link, in case of an exception.

◆ sendQueueMaxSize() [1/2]

size_t sendQueueMaxSize ( ) const

Returns the send queue maximum size in bytes.

When it is not set, the corresponding Engine setting's value is used (0.5 GB by default).

◆ sendQueueMaxSize() [2/2]

Session & sendQueueMaxSize ( size_t size)

Sets the send queue maximum size in bytes.

The TCP connection will be disconnected when an overflow issue happens and the sending queue size exceeds this size.

Note
This call is thread-safe.

◆ sendReject()

Session & sendReject ( SequenceNumber refSeqNumber,
const std::string & text )

Sends the Reject (MsgType 3) message.

Parameters
refSeqNumberThe MsgSeqNum of rejected message.
textThe message to explain the reason for the rejection.
Note
This call is thread-safe.

◆ sendResendRequest()

Session & sendResendRequest ( SequenceNumber beginSeqNumber)

Sends the Resend Request (MsgType 2) message.

Note
Normally, the "Resend Request" message is sent automatically. This method allows to simulate a sequence gap by sending this message manually. This can be needed in some venue specific cases. This method should not be used in the normal work.
Parameters
beginSeqNumberThe begin sequence number of the first requested message in the range.
Note
This call is thread-safe.

◆ sendResendRequestOnEachMessageGap() [1/2]

bool sendResendRequestOnEachMessageGap ( ) const

Returns 'true' if the "Resend Request" message is sent on each detected message sequence number gap, otherwise - 'false'.

◆ sendResendRequestOnEachMessageGap() [2/2]

Session & sendResendRequestOnEachMessageGap ( bool send)

By default, the "Resend Request" message is sent only once - when the first gap is detected.

This property allows to change this behavior and send the "Resend Request" message on each detected message sequence number gap.

◆ sendSpinningTimeout()

int sendSpinningTimeout ( ) const

Returns the current send spinning timeout value (in microseconds).

By default, the value is zero and send spinning is not used.

◆ sendSpinningTimeoutUsec()

Session & sendSpinningTimeoutUsec ( int usec)

Sets the send spinning timeout (in microseconds) of the Session::send(..) method to wait for the socket sending buffer availability in the spin loop mode before placing the message to the outgoing queue (to be sent later by the sending thread).

Note
Should not be greater than 1 sec (minimal heartbeatIntervalSec()).

◆ sendTestRequest()

Session & sendTestRequest ( const std::string & testReqId = "",
const TimeSpan & timeout = TimeSpan::zero() )

Sends the Test Request (MsgType 1) message.

If the timeout is specified, the method blocks until the heartbeat message is received from the counterparty or timeout ended.

Parameters
testReqIdThe identifier included in the Test Request (MsgType 1) message to be returned in the resulting Heartbeat (MsgType 0) message from the counterparty.
timeoutThe maximum interval to wait until the reply is received from the counterparty.
Note
This call is thread-safe.

◆ shutdown()

Session & shutdown ( )

Shutdowns the session.

Note
This call is thread-safe.

◆ socketHandle()

OnixS::Sockets::Handle socketHandle ( )

Returns the socket handle which the session uses to transmit the FIX data.

Note
This call is thread-safe.

◆ socketOptions()

Session & socketOptions ( const OnixS::Sockets::SocketOptions & options)

Additional options, which should be set to the session socket when it is created.

For initiator sessions, options are set before the socket connect(..) call. For acceptor sessions, options are set after the socket accept(..) call.

◆ specifyLastMsgSeqNumProcessed() [1/2]

bool specifyLastMsgSeqNumProcessed ( ) const

Returns 'true' if the LastMsgSeqNumProcessed (tag 369) field is specified on every message sent, otherwise - 'false'.

By default, the option value is false.

◆ specifyLastMsgSeqNumProcessed() [2/2]

Session & specifyLastMsgSeqNumProcessed ( bool specify)

The option to specify the LastMsgSeqNumProcessed (tag 369) field on every message sent.

Useful for detecting a backlog with a counterparty.

Note
The option does not affect the FlatMessage send.

◆ sslCaFile() [1/2]

std::string sslCaFile ( ) const

Returns the path to the trusted certification authority certificate file in the (Privacy Enhanced Mail) Base64 encoded (.pem) format.

Note
This call is thread-safe.

◆ sslCaFile() [2/2]

Session & sslCaFile ( const std::string & value)

Sets the path to the trusted certification authority certificate file in (Privacy Enhanced Mail) Base64 encoded (.pem) format.

Note
This call is thread-safe.

◆ sslCertificateFile() [1/2]

std::string sslCertificateFile ( ) const

Returns the SSL certificate file.

Note
This call is thread-safe.

◆ sslCertificateFile() [2/2]

Session & sslCertificateFile ( const std::string & file)

Sets the SSL certificate file.

Note
Only the (Privacy Enhanced Mail) Base 64 Encoded (.pem) SSL certificates are supported.
This call is thread-safe.

◆ sslClientSni() [1/2]

const std::string & sslClientSni ( ) const

Returns the client-side SNI-extension field.

◆ sslClientSni() [2/2]

Session & sslClientSni ( const std::string & hostName)

Sets the client-side SNI-extension field.

When is not empty, then this field provides SNI-name. When field value is "*" (wildcard), then SNI-name will be taken from the connection URL.

Note
Connection URL cannot be an IP address when the value "*" is used.

◆ sslMaxProtocolVersion() [1/2]

SslProtocolMinMaxVersion::Enum sslMaxProtocolVersion ( ) const

Returns the maximal SSL/TLS protocol version that will be declared during the SSL/TLS handshake.

Note
This call is thread-safe.

◆ sslMaxProtocolVersion() [2/2]

Session & sslMaxProtocolVersion ( SslProtocolMinMaxVersion::Enum version)

Sets the maximal SSL/TLS protocol version that will be declared during the SSL/TLS handshake.

Note
This call is thread-safe.

◆ sslMinProtocolVersion() [1/2]

SslProtocolMinMaxVersion::Enum sslMinProtocolVersion ( ) const

Returns the minimal SSL/TLS protocol version that will be declared during the SSL/TLS handshake.

Note
This call is thread-safe.

◆ sslMinProtocolVersion() [2/2]

Session & sslMinProtocolVersion ( SslProtocolMinMaxVersion::Enum version)

Sets the minimal SSL/TLS protocol version that will be declared during the SSL/TLS handshake.

Note
This call is thread-safe.

◆ sslPrivateKeyFile() [1/2]

std::string sslPrivateKeyFile ( ) const

Returns the SSL private key file.

Note
This call is thread-safe.

◆ sslPrivateKeyFile() [2/2]

Session & sslPrivateKeyFile ( const std::string & file)

Sets the SSL private key file.

Note
Only the (Privacy Enhanced Mail) Base 64 Encoded (.pem) SSL certificates are supported.
This call is thread-safe.

◆ sslPrivateKeyPassword() [1/2]

Cryptography::SecureString sslPrivateKeyPassword ( ) const

Returns the SSL private key file password.

Note
This call is thread-safe.

◆ sslPrivateKeyPassword() [2/2]

Session & sslPrivateKeyPassword ( const Cryptography::SecureString & password)

Sets the SSL private key file password.

Note
This call is thread-safe.

◆ sslVerifyPeer() [1/2]

bool sslVerifyPeer ( ) const

Returns the option to request peer certificates and perform the certificate verification.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

Note
This call is thread-safe.

◆ sslVerifyPeer() [2/2]

Session & sslVerifyPeer ( bool verify)

Set the option to request peer certificates and perform the certificate verification.

Note
This call is thread-safe.

◆ state()

SessionState::Enum state ( ) const

Returns the Session's state.

Note
This call is thread-safe.

◆ storageId()

const std::string & storageId ( ) const

Returns the underlying storage Id.

Note
This call is thread-safe.

◆ supportNextExpectedMsgSeqNum() [1/2]

bool supportNextExpectedMsgSeqNum ( ) const

Returns 'true' if the NextExpectedMsgSeqNum field (tag 789) is supported in Logon messages, otherwise - 'false'.

By default, the option value is false.

◆ supportNextExpectedMsgSeqNum() [2/2]

Session & supportNextExpectedMsgSeqNum ( bool support)

Sets the NextExpectedMsgSeqNum field (tag 789) support in Logon messages.

◆ targetCompId()

const std::string & targetCompId ( ) const

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

Note
This call is thread-safe.

◆ targetLocationId() [1/2]

std::string targetLocationId ( ) const

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

Note
This call is thread-safe.

◆ targetLocationId() [2/2]

Session & targetLocationId ( const std::string & value)

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

Note
This call is thread-safe.

◆ targetSubId() [1/2]

std::string targetSubId ( ) const

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

Note
This call is thread-safe.

◆ targetSubId() [2/2]

Session & targetSubId ( const std::string & value)

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

Note
This call is thread-safe.

◆ tcpNoDelayOption() [1/2]

bool tcpNoDelayOption ( ) const

Returns the option to improve the latency at the expense of the message throughput (TCP_NODELAY socket option).

When it is not set, the corresponding Engine setting's value is used ('true' by default).

◆ tcpNoDelayOption() [2/2]

Session & tcpNoDelayOption ( bool improveLatency = true)

Sets the value of the option to improve the latency at the expense of the message throughput (TCP_NODELAY socket option).

◆ threadingModel() [1/2]

ThreadingModel::Enum threadingModel ( ) const

Returns the connection mode.

◆ threadingModel() [2/2]

Session & threadingModel ( ThreadingModel::Enum value)

Sets the connection mode.

◆ threadNameSuffix() [1/2]

std::string threadNameSuffix ( ) const

Returns the thread name suffix for receiving (R:threadNameSuffix) and sending (S:threadNameSuffix) threads.

Note
This call is thread-safe.

◆ threadNameSuffix() [2/2]

Session & threadNameSuffix ( const std::string & value)

Sets the thread name suffix for receiving ("R:threadNameSuffix") and sending ("S:threadNameSuffix") threads.

If the threadNameSuffix is not specified, it is set by default to ("R:senderCompId-targetCompId")("S:senderCompId-targetCompId").

Note
This method can be called only when the session is disconnected.
Exceptions
Anexception if the session state is not Disconnected.
Note
This call is thread-safe.

◆ throttle()

Session & throttle ( )

Performs the throttling of a session that must be called before each send function call.

If the count of messages per time unit exceeds the throttling limit, the function will be blocked until the given time interval is passed.

Note
This call is thread-safe.

◆ throttlingLimit()

Session & throttlingLimit ( size_t messagesCount,
size_t intervalInMs = 1000 )

Sets throttling limit parameters.

Parameters
messagesCountThe message limit per time unit.
intervalInMsThe time interval to limit messages.
Note
This call is thread-safe.

◆ toString()

std::string toString ( ) const

Returns the session string presentation.

Note
This call is thread-safe.

◆ tryThrottle()

size_t tryThrottle ( bool resetWhenDelay = false)

Checks the throttling of a session that must be called before each send function call.

If the count of messages per time unit exceeds the throttling limit, the function returns the delay (in milliseconds) until the sending becomes possible. Otherwise, it returns 0.

Parameters
resetWhenDelayThe flag to indicate if the amount of messages per throttling interval should be reset when a delay is returned.
Note
This call is thread-safe.

◆ unregisterAllListeners()

Session & unregisterAllListeners ( )

Unregisters all Session listener.

◆ unregisterListener()

Session & unregisterListener ( ISessionListener * listener)

Unregisters the Session listener.

◆ updateSendingTimeField() [1/2]

bool updateSendingTimeField ( ) const

Returns 'true' if updating of the SendingTime is turn on for every message, otherwise - 'false'.

By default, the option value is true.

◆ updateSendingTimeField() [2/2]

Session & updateSendingTimeField ( bool specify)

The option to specify updating of the SendingTime of every sent message.

◆ useSpinLock() [1/2]

bool useSpinLock ( ) const

Returns whether the Session uses the spin lock.

◆ useSpinLock() [2/2]

Session & useSpinLock ( bool value)

Sets the Session to use the spin lock.

◆ validateChecksum() [1/2]

bool validateChecksum ( ) const

Returns the option that controls the validation of the checksum of the incoming message.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateChecksum() [2/2]

Session & validateChecksum ( bool )

Sets the validation of the checksum of the incoming message.

◆ validateDuplicatedField() [1/2]

bool validateDuplicatedField ( ) const

Returns the option that controls the duplicated field validation.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateDuplicatedField() [2/2]

Session & validateDuplicatedField ( bool )

Sets value of the option that controls the duplicated field validation.

◆ validateEmptyFieldValues() [1/2]

bool validateEmptyFieldValues ( ) const

Returns the option to validate the empty field values of FIX messages in accordance with the FIX protocol or its FIX Dictionary.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateEmptyFieldValues() [2/2]

Session & validateEmptyFieldValues ( bool )

Sets the option to validate the empty field values of FIX messages in accordance with the FIX protocol or its FIX Dictionary.

◆ validateFieldValues() [1/2]

bool validateFieldValues ( ) const

Returns the option to validate the field values of FIX messages in accordance with the FIX protocol or its FIX Dictionary.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateFieldValues() [2/2]

Session & validateFieldValues ( bool )

Sets the option to validate the field values of FIX messages in accordance with the FIX protocol or its FIX Dictionary.

◆ validateRepeatingGroupEntryCount() [1/2]

bool validateRepeatingGroupEntryCount ( ) const

Returns the option that controls the repeating group entry count validation.

When it is not set, the corresponding Engine setting's value is used ('true' by default).

◆ validateRepeatingGroupEntryCount() [2/2]

Session & validateRepeatingGroupEntryCount ( bool )

Sets the value of the option that controls the repeating group entry count validation.

◆ validateRepeatingGroupLeadingTag() [1/2]

bool validateRepeatingGroupLeadingTag ( ) const

Returns the option that controls the repeating group leading tag validation.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateRepeatingGroupLeadingTag() [2/2]

Session & validateRepeatingGroupLeadingTag ( bool )

Sets the value of the option that controls the repeating group leading tag validation.

◆ validateRequiredFields() [1/2]

bool validateRequiredFields ( ) const

Returns the option to validate the presence of required fields in inbound and outbound messages.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateRequiredFields() [2/2]

Session & validateRequiredFields ( bool )

Sets the option to validate the presence of required fields in inbound and outbound messages.

◆ validateSequenceNumbers() [1/2]

bool validateSequenceNumbers ( ) const

Returns the current status of the incoming message sequence numbers validation.

By default, the option value is true.

◆ validateSequenceNumbers() [2/2]

Session & validateSequenceNumbers ( bool value)

Options to turn on/off incoming message sequence numbers validation.

◆ validateUnknownFields() [1/2]

bool validateUnknownFields ( ) const

Returns the option to validate the presence of unknown fields.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateUnknownFields() [2/2]

Session & validateUnknownFields ( bool )

Sets the option to validate the presence of unknown fields.

◆ validateUnknownMessages() [1/2]

bool validateUnknownMessages ( ) const

Returns the option to validate the presence of unknown FIX messages.

When it is not set, the corresponding Engine setting's value is used ('false' by default).

◆ validateUnknownMessages() [2/2]

Session & validateUnknownMessages ( bool )

Sets the option to validate the presence of unknown FIX messages.

◆ warmUp()

Session & warmUp ( FlatMessage * msg,
int warmupFlags = 0 )

This method warms up the sending path.

Parameters
msgThe message to warm up the assembly part of the sending path.
warmupFlagsSpecific flags which can be used to turn on the warmup feature for a specific NIC.
Note
This call is thread-safe.

◆ Engine::Impl

friend class Engine::Impl
friend

Definition at line 1900 of file Session.h.

Member Data Documentation

◆ InvalidSocketHandle

const OnixS::Sockets::Handle InvalidSocketHandle
static

Represents an invalid value of the socket handle.

Definition at line 1692 of file Session.h.

◆ ResendRequestMaximumRangeNoLimit

const unsigned int ResendRequestMaximumRangeNoLimit
static

Represents an unlimited number of messages to be requested in one Resend Request (MsgType=2) message.

The default value is 0.

Definition at line 1231 of file Session.h.

◆ UndefinedPriorityAndPolicy

const int UndefinedPriorityAndPolicy
static

Represents an undefined value of priority and policy.

Definition at line 1373 of file Session.h.