OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
SessionSettings Class Reference

Classes

struct  Default
struct  Key

Public Types

typedef std::vector< std::string > LicenseStores

Public Member Functions

 SessionSettings ()
const std::string & userId () const noexcept
SessionSettingsuserId (const std::string &value)
Messaging::Int32 clientId () const noexcept
SessionSettingsclientId (Messaging::Int32 value)
const std::string & rawData () const noexcept
SessionSettingsrawData (const std::string &value)
ThreadingModel::Enum threadingModel () const noexcept
SessionSettingsthreadingModel (ThreadingModel::Enum value)
unsigned receiveSpinningTimeout () const noexcept
SessionSettingsreceiveSpinningTimeout (unsigned usecTimeout)
unsigned sendSpinningTimeout () const noexcept
SessionSettingssendSpinningTimeout (unsigned usecTimeout)
unsigned messageGrouping () const noexcept
SessionSettingsmessageGrouping (unsigned value)
SessionSettingsresetToDefaults ()
SessionSettingsaddLicenseStore (const std::string &value)
SessionSettingslicenseStore (const std::string &value)
const LicenseStoreslicenseStores () const noexcept
unsigned licenseAlertingDaysBeforeExpiration () const noexcept
SessionSettingslicenseAlertingDaysBeforeExpiration (unsigned days)
const std::string & localNetworkInterface () const noexcept
SessionSettingslocalNetworkInterface (const std::string &value)
const std::string & storageDirectory () const noexcept
SessionSettingsstorageDirectory (const std::string &value)
bool localTimeUsage () const noexcept
SessionSettingslocalTimeUsage (bool)
Messaging::UInt64 fileBasedStorageSegmentSize () const noexcept
SessionSettingsfileBasedStorageSegmentSize (Messaging::UInt64 value)
unsigned asyncFileBasedStorageQueueMaxSize () const noexcept
SessionSettingsasyncFileBasedStorageQueueMaxSize (unsigned value)
const CpuIndexesasyncFileBasedStorageThreadAffinity () const noexcept
SessionSettingsasyncFileBasedStorageThreadAffinity (const CpuIndexes &cpuIndexes)
bool ignoreFileBasedStorageIntegrityErrors () const noexcept
SessionSettingsignoreFileBasedStorageIntegrityErrors (bool)
bool logBeforeSending () const noexcept
SessionSettingslogBeforeSending (bool before)
unsigned reconnectAttempts () const noexcept
SessionSettingsreconnectAttempts (unsigned reconnectAttempts)
unsigned reconnectInterval () const noexcept
SessionSettingsreconnectInterval (unsigned value)
int socketReceiveBufferSize () const noexcept
SessionSettingssocketReceiveBufferSize (int bufferSize)
unsigned reasonableTransmissionTime () const noexcept
SessionSettingsreasonableTransmissionTime (unsigned percentage)
int socketSendBufferSize () const noexcept
SessionSettingssocketSendBufferSize (int bufferSize)
const CpuIndexesthreadPoolAffinity () const noexcept
SessionSettingsthreadPoolAffinity (const CpuIndexes &cpuIndexes)
int threadPoolPriority () const noexcept
SessionSettingsthreadPoolPriority (int priority)
int threadPoolPolicy () const noexcept
SessionSettingsthreadPoolPolicy (int policy)
bool tcpNoDelayOption () const noexcept
SessionSettingstcpNoDelayOption (bool value)
unsigned threadPoolSize () const noexcept
SessionSettingsthreadPoolSize (unsigned numberOfThreads)
unsigned short keepAliveInterval () const noexcept
SessionSettingskeepAliveInterval (unsigned short seconds)
bool reportNewMessagesWhileWaitingForMissedMessages () const noexcept
SessionSettingsreportNewMessagesWhileWaitingForMissedMessages (bool report)
SessionSettingslocalPortRange (PortRange range)
PortRange localPortRange () const noexcept
SessionSettingsmessagingSchemaVersion (Messaging::SchemaVersion schema)
Messaging::SchemaVersion messagingSchemaVersion () const noexcept
bool useSpinLock () const noexcept
SessionSettingsuseSpinLock (bool value)
bool enableRxTimestamp () const noexcept
SessionSettingsenableRxTimestamp (bool value)
bool useTLS () const noexcept
SessionSettingsuseTLS (bool value)
LogLevel::Enum logLevel () const noexcept
SessionSettingslogLevel (LogLevel::Enum value)
LogSettings::Enum loggerOptions () const noexcept
SessionSettingsloggerOptions (LogSettings::Enum value)
SessionSettingsload (const std::string &configFile)
std::string toString () const

Static Public Attributes

static const int UseOsDefaultSocketBufferSize = -1

Detailed Description

Definition at line 37 of file SessionSettings.h.

Member Typedef Documentation

◆ LicenseStores

typedef std::vector<std::string> LicenseStores

Folders that contain license file(s).

Definition at line 150 of file SessionSettings.h.

Constructor & Destructor Documentation

◆ SessionSettings()

Member Function Documentation

◆ addLicenseStore()

SessionSettings & addLicenseStore ( const std::string & value)

Adds the path to the folder that contains license file(s).

◆ asyncFileBasedStorageQueueMaxSize() [1/2]

unsigned asyncFileBasedStorageQueueMaxSize ( ) const
inlinenoexcept
Returns
the maximum size of the asynchronous session storage queue.

By default, the size is unlimited.

Definition at line 248 of file SessionSettings.h.

249 {
250 return asyncFileBasedStorageQueueMaxSize_;
251 }

◆ asyncFileBasedStorageQueueMaxSize() [2/2]

SessionSettings & asyncFileBasedStorageQueueMaxSize ( unsigned value)

Sets the maximum size of the asynchronous session storage queue.

◆ asyncFileBasedStorageThreadAffinity() [1/2]

const CpuIndexes & asyncFileBasedStorageThreadAffinity ( ) const
inlinenoexcept
Returns
the CPU index(es) for affinity of the asynchronous session storage threads.

By default, the affinity is not set.

Definition at line 261 of file SessionSettings.h.

262 {
263 return asyncFileBasedStorageThreadAffinity_;
264 }

◆ asyncFileBasedStorageThreadAffinity() [2/2]

SessionSettings & asyncFileBasedStorageThreadAffinity ( const CpuIndexes & cpuIndexes)

Specifies the CPU index(es) for affinity of the asynchronous session storage threads.

◆ clientId() [1/2]

Messaging::Int32 clientId ( ) const
inlinenoexcept
Returns
the firm id that was assigned by the exchange.

The default value is empty.

Definition at line 60 of file SessionSettings.h.

61 {
62 return clientId_;
63 }

◆ clientId() [2/2]

SessionSettings & clientId ( Messaging::Int32 value)

Sets the firm id that was assigned by the exchange.

◆ enableRxTimestamp() [1/2]

bool enableRxTimestamp ( ) const
inlinenoexcept
Returns
the value of the option to enable received data timestamp.

The default value is false.

Definition at line 509 of file SessionSettings.h.

510 {
511 return enableRxTimestamp_;
512 }

◆ enableRxTimestamp() [2/2]

SessionSettings & enableRxTimestamp ( bool value)

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

Note
available on Linux only

◆ fileBasedStorageSegmentSize() [1/2]

Messaging::UInt64 fileBasedStorageSegmentSize ( ) const
inlinenoexcept
Returns
the segment size for the file-based session storage.

The default value is Default::FileBasedStorageSegmentSize.

Definition at line 235 of file SessionSettings.h.

236 {
237 return fileBasedStorageSegmentSize_;
238 }

◆ fileBasedStorageSegmentSize() [2/2]

SessionSettings & fileBasedStorageSegmentSize ( Messaging::UInt64 value)

Sets the segment size for file-based session storage.

◆ ignoreFileBasedStorageIntegrityErrors() [1/2]

bool ignoreFileBasedStorageIntegrityErrors ( ) const
inlinenoexcept
Returns
The file-based storage integrity errors checking mode:
  • true - ignore errors and create a new storage
  • false - throw an exception

The default value is Default::IgnoreFileBasedStorageIntegrityErrors.

Definition at line 277 of file SessionSettings.h.

278 {
279 return ignoreFileBasedStorageIntegrityErrors_;
280 }

◆ ignoreFileBasedStorageIntegrityErrors() [2/2]

SessionSettings & ignoreFileBasedStorageIntegrityErrors ( bool )

Sets the file-based storage integrity errors checking mode.

◆ keepAliveInterval() [1/2]

unsigned short keepAliveInterval ( ) const
inlinenoexcept
Returns
the longest time in seconds the client system can remain silent before sending a message.

The default value is Default::KeepAliveInterval.

Definition at line 439 of file SessionSettings.h.

440 {
441 return keepAliveInterval_;
442 }

◆ keepAliveInterval() [2/2]

SessionSettings & keepAliveInterval ( unsigned short seconds)

Sets the longest time in seconds the client system can remain silent before sending a message.

Note
The minimum is 1 second.

◆ licenseAlertingDaysBeforeExpiration() [1/2]

unsigned licenseAlertingDaysBeforeExpiration ( ) const
inlinenoexcept
Returns
the number of days to alert before the license expiration.

The default value is Default::LicenseAlertingDaysBeforeExpiration.

Definition at line 165 of file SessionSettings.h.

166 {
167 return licenseAlertingDaysBeforeExpiration_;
168 }

◆ licenseAlertingDaysBeforeExpiration() [2/2]

SessionSettings & licenseAlertingDaysBeforeExpiration ( unsigned days)
inline

Sets the number of days to alert before the license expiration.

If the amount of remaining license days is less or equal to this number, then the warning is reported to the Handler's log.

The verification is performed during the Session::connect call.

Definition at line 177 of file SessionSettings.h.

178 {
179 licenseAlertingDaysBeforeExpiration_ = days;
180 return *this;
181 }

◆ licenseStore()

SessionSettings & licenseStore ( const std::string & value)

Sets the path to the folder that contains license file(s).

◆ licenseStores()

const LicenseStores & licenseStores ( ) const
inlinenoexcept
Returns
path(s) to the folder that contains license file(s).

The default value is '.'.

Definition at line 156 of file SessionSettings.h.

157 {
158 return licenseStores_;
159 }

◆ load()

SessionSettings & load ( const std::string & configFile)

Loads the settings from the given configuration file.

See also
Key

◆ localNetworkInterface() [1/2]

const std::string & localNetworkInterface ( ) const
inlinenoexcept
Returns
The interface name or IP-address from which the Handler connects to the counterparty.

The default value is empty.

Definition at line 187 of file SessionSettings.h.

188 {
189 return localNetworkInterface_;
190 }

◆ localNetworkInterface() [2/2]

SessionSettings & localNetworkInterface ( const std::string & value)

Specifies the local interface from which the Handler connects to the counterparty.

Each local interface specification could specify the local IP address and port. For instance, localhost and 192.168.0.1:4501 are valid values.

◆ localPortRange() [1/2]

PortRange localPortRange ( ) const
inlinenoexcept
Returns
the range of the local ports to be used

Definition at line 474 of file SessionSettings.h.

475 {
476 return localPortRange_;
477 }

◆ localPortRange() [2/2]

SessionSettings & localPortRange ( PortRange range)

Sets the range of the local ports to be used.

◆ localTimeUsage() [1/2]

bool localTimeUsage ( ) const
inlinenoexcept
Returns
the usage of the local time in Handler events and log files.

The default value is Default::LocalTimeUsage.

Definition at line 220 of file SessionSettings.h.

221 {
222 return localTimeUsage_;
223 }

◆ localTimeUsage() [2/2]

SessionSettings & localTimeUsage ( bool )

Specifies the usage of the local time in Handler events and log files.

If it is true, then the local time is used; otherwise - UTC.

◆ logBeforeSending() [1/2]

bool logBeforeSending ( ) const
inlinenoexcept
Returns
true if outbound messages are logged before sending, 'false' otherwise.

The default value is Default::LogBeforeSending.

Definition at line 290 of file SessionSettings.h.

291 {
292 return logBeforeSending_;
293 }

◆ logBeforeSending() [2/2]

SessionSettings & logBeforeSending ( bool before)

Controls the order of logging and sending outbound messages.

Parameters
beforeif 'true' then outbound messages are logged before sending.

◆ loggerOptions() [1/2]

LogSettings::Enum loggerOptions ( ) const
inlinenoexcept
Returns
the the the logger options.

The default value is LogLevel::Info.

Definition at line 549 of file SessionSettings.h.

550 {
551 return loggerOptions_;
552 }

◆ loggerOptions() [2/2]

SessionSettings & loggerOptions ( LogSettings::Enum value)

Sets the the logger options.

◆ logLevel() [1/2]

LogLevel::Enum logLevel ( ) const
inlinenoexcept

The default value is LogLevel::Info.

Returns
the severity level of log messages.

Definition at line 536 of file SessionSettings.h.

537 {
538 return logLevel_;
539 }

◆ logLevel() [2/2]

SessionSettings & logLevel ( LogLevel::Enum value)

Sets the severity level of log messages.

◆ messageGrouping() [1/2]

unsigned messageGrouping ( ) const
inlinenoexcept
Returns
the message grouping mode.
  • 0 means default grouping - the messages are sent immediately, and pending messages (if any) are grouped till reaching of the TCP buffer size.
  • 1 means the messages are sent immediately and never grouped.
  • 2 (or higher) means the messages are sent immediately, and pending messages are grouped by 2 (or higher).

The default value is Default::MessageGrouping.

Definition at line 129 of file SessionSettings.h.

130 {
131 return messageGrouping_;
132 }

◆ messageGrouping() [2/2]

SessionSettings & messageGrouping ( unsigned value)

Sets the message grouping mode.

◆ messagingSchemaVersion() [1/2]

Messaging::SchemaVersion messagingSchemaVersion ( ) const
inlinenoexcept
Returns
the version of the message schema.

Definition at line 487 of file SessionSettings.h.

488 {
489 return messagingSchemaVersion_;
490 }

◆ messagingSchemaVersion() [2/2]

SessionSettings & messagingSchemaVersion ( Messaging::SchemaVersion schema)

Specifies the version of the message schema.

Allowed range is between Messaging::SchemaTraits::MinimalVersion - Messaging::SchemaTraits::Version. The default value is Messaging::SchemaTraits::Version.

◆ rawData() [1/2]

const std::string & rawData ( ) const
inlinenoexcept
Returns
the secret key that was assigned by the exchange.

The default value is empty.

Definition at line 73 of file SessionSettings.h.

74 {
75 return rawData_;
76 }

◆ rawData() [2/2]

SessionSettings & rawData ( const std::string & value)

Sets the secret key that was assigned by the exchange.

◆ reasonableTransmissionTime() [1/2]

unsigned reasonableTransmissionTime ( ) const
inlinenoexcept
Returns
the reasonable transmission time - as the percentage from the KeepAliveInterval value.

The default value is Default::ReasonableTransmissionTime.

Definition at line 351 of file SessionSettings.h.

352 {
353 return reasonableTransmissionTime_;
354 }

◆ reasonableTransmissionTime() [2/2]

SessionSettings & reasonableTransmissionTime ( unsigned percentage)

Sets the reasonable transmission time - as the percentage from the KeepAliveInterval value.

◆ receiveSpinningTimeout() [1/2]

unsigned receiveSpinningTimeout ( ) const
inlinenoexcept
Returns
the receive spinning timeout (microseconds).

The default value is Default::ReceiveSpinningTimeout.

Definition at line 99 of file SessionSettings.h.

100 {
101 return receiveSpinningTimeout_;
102 }

◆ receiveSpinningTimeout() [2/2]

SessionSettings & receiveSpinningTimeout ( unsigned usecTimeout)

Sets the receive spinning timeout (microseconds).

◆ reconnectAttempts() [1/2]

unsigned reconnectAttempts ( ) const
inlinenoexcept
Returns
the maximum number of tries to restore the telecommunications link.

The default value is Default::ReconnectAttempts.

Definition at line 305 of file SessionSettings.h.

306 {
307 return reconnectAttempts_;
308 }

◆ reconnectAttempts() [2/2]

SessionSettings & reconnectAttempts ( unsigned reconnectAttempts)

Sets the maximum number of tries to restore the telecommunications link.

◆ reconnectInterval() [1/2]

unsigned reconnectInterval ( ) const
inlinenoexcept
Returns
the time interval between retries to restore the telecommunications link (seconds).

The default value is Default::ReconnectInterval.

Definition at line 318 of file SessionSettings.h.

319 {
320 return reconnectInterval_;
321 }

◆ reconnectInterval() [2/2]

SessionSettings & reconnectInterval ( unsigned value)

Sets the time interval between retries to restore the telecommunications link (seconds).

Should not be zero.

◆ reportNewMessagesWhileWaitingForMissedMessages() [1/2]

bool reportNewMessagesWhileWaitingForMissedMessages ( ) const
inlinenoexcept
Returns
true if new messages are reported even when the message gap is detected, and the reply on the Retransmit Request message is expected; otherwise - false.

The default value is Default::ReportNewMessagesWhileWaitingForMissedMessages.

Definition at line 457 of file SessionSettings.h.

458 {
459 return reportNewMessagesWhileWaitingForMissedMessages_;
460 }

◆ reportNewMessagesWhileWaitingForMissedMessages() [2/2]

SessionSettings & reportNewMessagesWhileWaitingForMissedMessages ( bool report)

Sets the option to report new messages even when the message gap is detected, and the reply on the Retransmit Request message is expected.

◆ resetToDefaults()

SessionSettings & resetToDefaults ( )

Resets the settings to the default values.

◆ sendSpinningTimeout() [1/2]

unsigned sendSpinningTimeout ( ) const
inlinenoexcept
Returns
the send spinning timeout (microseconds).

The default value is Default::SendSpinningTimeout.

Definition at line 112 of file SessionSettings.h.

113 {
114 return sendSpinningTimeout_;
115 }

◆ sendSpinningTimeout() [2/2]

SessionSettings & sendSpinningTimeout ( unsigned usecTimeout)

Sets the send spinning timeout (microseconds).

◆ socketReceiveBufferSize() [1/2]

int socketReceiveBufferSize ( ) const
inlinenoexcept
Returns
the socket receive buffer size.

The default value is Default::SocketReceiveBufferSize.

Definition at line 335 of file SessionSettings.h.

336 {
337 return socketReceiveBufferSize_;
338 }

◆ socketReceiveBufferSize() [2/2]

SessionSettings & socketReceiveBufferSize ( int bufferSize)

Sets the socket receive buffer size.

Parameters
bufferSizethe size of the socket receive buffer size. If SessionSettings::UseOsDefaultSocketBufferSize then the default operating system value is used.

◆ socketSendBufferSize() [1/2]

int socketSendBufferSize ( ) const
inlinenoexcept
Returns
the size of the socket send buffer size.

The default value is Default::SocketSendBufferSize.

Definition at line 364 of file SessionSettings.h.

365 {
366 return socketSendBufferSize_;
367 }

◆ socketSendBufferSize() [2/2]

SessionSettings & socketSendBufferSize ( int bufferSize)

Sets the size of the socket send buffer size.

Parameters
bufferSizethe size of the socket send buffer size. If SessionSettings::UseOsDefaultSocketBufferSize then the default operating system value is used.

◆ storageDirectory() [1/2]

const std::string & storageDirectory ( ) const
inlinenoexcept
Returns
the Session Storage directory.

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

The default value is MsgStorage.

Definition at line 205 of file SessionSettings.h.

206 {
207 return storageDirectory_;
208 }

◆ storageDirectory() [2/2]

SessionSettings & storageDirectory ( const std::string & value)

Sets the Session Storage directory.

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

◆ tcpNoDelayOption() [1/2]

bool tcpNoDelayOption ( ) const
inlinenoexcept
Returns
the value of the option to improve latency at the expense of message throughput (the TCP_NODELAY socket option).

The default value is Default::TcpNoDelayOption.

Definition at line 413 of file SessionSettings.h.

414 {
415 return tcpNoDelayOption_;
416 }

◆ tcpNoDelayOption() [2/2]

SessionSettings & tcpNoDelayOption ( bool value)

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

◆ threadingModel() [1/2]

ThreadingModel::Enum threadingModel ( ) const
inlinenoexcept
Returns
the threading model.

The default value is Default::ThreadingModelValue.

Definition at line 86 of file SessionSettings.h.

87 {
88 return threadingModel_;
89 }

◆ threadingModel() [2/2]

SessionSettings & threadingModel ( ThreadingModel::Enum value)

Sets the threading model.

◆ threadPoolAffinity() [1/2]

const CpuIndexes & threadPoolAffinity ( ) const
inlinenoexcept
Returns
the thread pool affinity.

Definition at line 378 of file SessionSettings.h.

379 {
380 return threadPoolAffinity_;
381 }

◆ threadPoolAffinity() [2/2]

SessionSettings & threadPoolAffinity ( const CpuIndexes & cpuIndexes)

Sets the thread pool affinity.

◆ threadPoolPolicy() [1/2]

int threadPoolPolicy ( ) const
inlinenoexcept
Returns
the thread pool policy.

Definition at line 400 of file SessionSettings.h.

401 {
402 return threadPoolPolicy_;
403 }

◆ threadPoolPolicy() [2/2]

SessionSettings & threadPoolPolicy ( int policy)

Sets the thread pool policy.

◆ threadPoolPriority() [1/2]

int threadPoolPriority ( ) const
inlinenoexcept
Returns
the thread pool priority.

Definition at line 389 of file SessionSettings.h.

390 {
391 return threadPoolPriority_;
392 }

◆ threadPoolPriority() [2/2]

SessionSettings & threadPoolPriority ( int priority)

Sets the thread pool priority.

◆ threadPoolSize() [1/2]

unsigned threadPoolSize ( ) const
inlinenoexcept
Returns
the size of the shared thread pool.

The default value is Default::ThreadPoolSize.

Definition at line 426 of file SessionSettings.h.

427 {
428 return threadPoolSize_;
429 }

◆ threadPoolSize() [2/2]

SessionSettings & threadPoolSize ( unsigned numberOfThreads)

Sets the size of the shared thread pool.

◆ toString()

std::string toString ( ) const
Returns
the human-friendly description.

◆ userId() [1/2]

const std::string & userId ( ) const
inlinenoexcept
Returns
the session id that was assigned by the exchange.

The default value is empty.

Definition at line 47 of file SessionSettings.h.

48 {
49 return userId_;
50 }

◆ userId() [2/2]

SessionSettings & userId ( const std::string & value)

Sets the session id that was assigned by the exchange.

◆ useSpinLock() [1/2]

bool useSpinLock ( ) const
inlinenoexcept
Returns
the value of the option to use spin lock.

The default value is false.

Definition at line 496 of file SessionSettings.h.

497 {
498 return useSpinLock_;
499 }

◆ useSpinLock() [2/2]

SessionSettings & useSpinLock ( bool value)

Sets the value of the option to the option to use spin lock.

◆ useTLS() [1/2]

bool useTLS ( ) const
inlinenoexcept
Returns
the value of the option to enable TLS.

The default value is false.

Definition at line 523 of file SessionSettings.h.

524 {
525 return useTLS_;
526 }

◆ useTLS() [2/2]

SessionSettings & useTLS ( bool value)

Sets the value of the option to enable TLS.

Member Data Documentation

◆ UseOsDefaultSocketBufferSize

const int UseOsDefaultSocketBufferSize = -1
static

Specifies the usage of the operating system default socket buffer size.

Definition at line 329 of file SessionSettings.h.