OnixS C++ B3 BOE Binary Order Entry  1.2.0
API Documentation
SessionSettings.h
Go to the documentation of this file.
1 /*
2  * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3  *
4  * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5  * and international copyright treaties.
6  *
7  * Access to and use of the software is governed by the terms of the applicable OnixS Software
8  * Services Agreement (the Agreement) and Customer end user license agreements granting
9  * a non-assignable, non-transferable and non-exclusive license to use the software
10  * for it's own data processing purposes under the terms defined in the Agreement.
11  *
12  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13  * of this source code or associated reference material to any other location for further reproduction
14  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15  *
16  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17  * the terms of the Agreement is a violation of copyright law.
18  */
19 
20 #pragma once
21 
22 #include <OnixS/B3/BOE/ABI.h>
23 #include <OnixS/B3/BOE/Messaging.h>
25 
26 #include <climits>
27 #include <set>
28 #include <string>
29 #include <vector>
30 
31 namespace OnixS {
32 namespace B3 {
33 namespace BOE {
34 
35 /**
36  * Session settings.
37  */
39 {
40 public:
43 
44  /// \return the session id that was assigned by the exchange.
45  ///
46  /// The default value is empty.
49  return sessionId_;
50  }
51 
52  /// Sets the session id that was assigned by the exchange.
54  SessionSettings& sessionId(Messaging::SessionID value);
55 
56  /// \return the broker firm id that will enter orders.
57  ///
58  /// The default value is zero.
60  Messaging::UInt32 enteringFirm() const ONIXS_B3_BOE_NOTHROW {
61  return enteringFirm_;
62  }
63 
64  /// Sets the broker firm id that will enter orders.
66  SessionSettings& enteringFirm(Messaging::UInt32 value);
67 
68  /// \return The token provided by B3 for the FIXP session.
69  ///
70  /// The default value is empty.
72  const std::string & accessKey() const ONIXS_B3_BOE_NOTHROW {
73  return accessKey_;
74  }
75 
76  /// Sets the token provided by B3 for the FIXP session.
78  SessionSettings& accessKey(const std::string & value);
79 
80  /// \return The criteria used to initiate cancel on disconnect mechanism by the gateway.
81  ///
82  /// The default value is DoNotCancelOnDisconnectOrTerminate.
85  return cancelOnDisconnectType_;
86  }
87 
88  /// Sets the criteria used to initiate cancel on disconnect mechanism by the gateway.
91 
92  /// \return the trading system name.
93  ///
94  /// The default value is empty.
96  const std::string & tradingSystemName() const ONIXS_B3_BOE_NOTHROW {
97  return tradingSystemName_;
98  }
99 
100  /// Sets the trading system name.
102  SessionSettings& tradingSystemName(const std::string & value);
103 
104  /// \return the trading system version.
105  ///
106  /// The default value is empty.
108  const std::string & tradingSystemVersion() const ONIXS_B3_BOE_NOTHROW {
109  return tradingSystemVersion_;
110  }
111 
112  /// Sets the trading system version.
114  SessionSettings& tradingSystemVersion(const std::string & value);
115 
116  /// \return the threading model.
117  ///
118  /// The default value is Default::ThreadingModelValue.
121  return threadingModel_;
122  }
123 
124  /// Sets the threading model.
126  SessionSettings& threadingModel(ThreadingModel::Enum value);
127 
128  /// \return the receive spinning timeout (microseconds).
129  ///
130  /// The default value is Default::ReceiveSpinningTimeout.
133  return receiveSpinningTimeout_;
134  }
135 
136  /// Sets the receive spinning timeout (microseconds).
138  SessionSettings& receiveSpinningTimeout(unsigned usecTimeout);
139 
140  /// \return the send spinning timeout (microseconds).
141  ///
142  /// The default value is Default::SendSpinningTimeout.
145  return sendSpinningTimeout_;
146  }
147 
148  /// Sets the send spinning timeout (microseconds).
150  SessionSettings& sendSpinningTimeout(unsigned usecTimeout);
151 
152  /// \return the message grouping mode.
153  ///
154  /// - `0` means default grouping - the messages are sent immediately, and pending messages (if any) are grouped till reaching of the TCP buffer size.
155  /// - `1` means the messages are sent immediately and never grouped.
156  /// - `2` (or higher) means the messages are sent immediately, and pending messages are grouped by 2 (or higher).
157  ///
158  /// The default value is Default::MessageGrouping.
161  return messageGrouping_;
162  }
163 
164  /// Sets the message grouping mode.
166  SessionSettings& messageGrouping(unsigned value);
167 
168  /// Resets the settings to the default values.
169  SessionSettings& resetToDefaults();
170 
171  /// Adds the path to the folder that contains license file(s).
173  SessionSettings& addLicenseStore(const std::string& value);
174 
175  /// Sets the path to the folder that contains license file(s).
177  SessionSettings& licenseStore(const std::string & value);
178 
179  /// Folders that contain license file(s).
180  typedef std::vector<std::string> LicenseStores;
181 
182  /// \return path(s) to the folder that contains license file(s).
183  ///
184  /// The default value is '.'.
186  const LicenseStores& licenseStores() const ONIXS_B3_BOE_NOTHROW {
187  return licenseStores_;
188  }
189 
190  /// \return the number of days to alert before the license expiration.
191  ///
192  /// The default value is Default::LicenseAlertingDaysBeforeExpiration.
195  return licenseAlertingDaysBeforeExpiration_;
196  }
197 
198  /// Sets the number of days to alert before the license expiration.
199  ///
200  /// If the amount of remaining license days is less or equal to this number,
201  /// then the warning is reported to the Handler's log.
202  ///
203  /// The verification is performed during the Session::connect call.
205  SessionSettings& licenseAlertingDaysBeforeExpiration(unsigned days) {
206  licenseAlertingDaysBeforeExpiration_ = days;
207  return *this;
208  }
209 
210  /// \return The interface name or IP-address from which the Handler connects to the counterparty.
211  ///
212  /// The default value is empty.
214  const std::string & localNetworkInterface() const ONIXS_B3_BOE_NOTHROW {
215  return localNetworkInterface_;
216  }
217 
218  /// Specifies the local interface from which the Handler connects to the counterparty.
219  ///
220  /// Each local interface specification could specify the local IP address and port.
221  /// For instance, `localhost` and `192.168.0.1:4501` are valid values.
223  SessionSettings& localNetworkInterface(const std::string & value);
224 
225  /// \return the Handler log file name.
226  ///
227  /// The default value is `HandlerLog.txt`.
229  const std::string & logFileName() const ONIXS_B3_BOE_NOTHROW {
230  return logFileName_;
231  }
232 
233  /// Specifies the Handler log file name.
235  SessionSettings& logFileName(const std::string & value);
236 
237  /// \return the Session Storage directory.
238  ///
239  /// Inbound and outbound messages, session's state data and the Handler log file are stored in this directory.
240  ///
241  /// The default value is `MsgStorage`.
243  const std::string & storageDirectory() const ONIXS_B3_BOE_NOTHROW {
244  return storageDirectory_;
245  }
246 
247  /// Sets the Session Storage directory.
248  ///
249  /// Inbound and outbound messages, session's state data and the Handler log file are stored in this directory.
251  SessionSettings& storageDirectory(const std::string & value);
252 
253  /// \return the usage of the local time in Handler events and log files.
254  ///
255  /// The default value is Default::LocalTimeUsage.
258  return localTimeUsage_;
259  }
260 
261  /// Specifies the usage of the local time in Handler events and log files.
262  ///
263  /// If it is `true`, then the local time is used; otherwise - UTC.
265  SessionSettings& localTimeUsage(bool);
266 
267  /// \return the segment size for the file-based session storage.
268  ///
269  /// The default value is Default::FileBasedStorageSegmentSize.
272  return fileBasedStorageSegmentSize_;
273  }
274 
275  /// Sets the segment size for file-based session storage.
277  SessionSettings& fileBasedStorageSegmentSize(Messaging::UInt64 value);
278 
279  /// \return the maximum size of the asynchronous session storage queue.
280  ///
281  /// By default, the size is unlimited.
284  return asyncFileBasedStorageQueueMaxSize_;
285  }
286 
287  /// Sets the maximum size of the asynchronous session storage queue.
289  SessionSettings& asyncFileBasedStorageQueueMaxSize(unsigned value);
290 
291  /// \return the CPU index(es) for affinity of the asynchronous session storage threads.
292  ///
293  /// By default, the affinity is not set.
296  return asyncFileBasedStorageThreadAffinity_;
297  }
298 
299  /// Specifies the CPU index(es) for affinity of the asynchronous session storage threads.
301  SessionSettings& asyncFileBasedStorageThreadAffinity(const CpuIndexes & cpuIndexes);
302 
303  /// \return The file-based storage integrity errors checking mode:
304  ///
305  /// - `true` - ignore errors and create a new storage
306  /// - `false` - throw an exception
307  ///
308  /// The default value is Default::IgnoreFileBasedStorageIntegrityErrors.
311  return ignoreFileBasedStorageIntegrityErrors_;
312  }
313 
314  /// Sets the file-based storage integrity errors checking mode.
316  SessionSettings& ignoreFileBasedStorageIntegrityErrors(bool);
317 
318  /// \return `true` if outbound messages are logged before sending, 'false' otherwise.
319  ///
320  /// The default value is Default::LogBeforeSending.
323  return logBeforeSending_;
324  }
325 
326  /// Controls the order of logging and sending outbound messages.
327  ///
328  /// \param before if 'true' then outbound messages are logged before sending.
330  SessionSettings& logBeforeSending(bool before);
331 
332  /// \return the maximum number of tries to restore the telecommunications link.
333  ///
334  /// The default value is Default::ReconnectAttempts.
337  return reconnectAttempts_;
338  }
339 
340  /// Sets the maximum number of tries to restore the telecommunications link.
342  SessionSettings& reconnectAttempts(unsigned reconnectAttempts);
343 
344  /// \return the time interval between retries to restore the telecommunications link (seconds).
345  ///
346  /// The default value is Default::ReconnectInterval.
349  return reconnectInterval_;
350  }
351 
352  /// Sets the time interval between retries to restore the telecommunications link (seconds).
353  /// Should not be zero.
355  SessionSettings& reconnectInterval(unsigned value);
356 
357  /// Specifies the usage of the operating system default socket buffer size.
358  static const int UseOsDefaultSocketBufferSize = -1;
359 
360  /// \return the socket receive buffer size.
361  ///
362  /// The default value is Default::SocketReceiveBufferSize.
365  return socketReceiveBufferSize_;
366  }
367 
368  /// Sets the socket receive buffer size.
369  ///
370  /// \param bufferSize the size of the socket receive buffer size.
371  /// If SessionSettings::UseOsDefaultSocketBufferSize then the default operating system value is used.
373  SessionSettings& socketReceiveBufferSize(int bufferSize);
374 
375  /// \return the reasonable transmission time - as the percentage from the `KeepAliveInterval` value.
376  ///
377  /// The default value is Default::ReasonableTransmissionTime.
380  return reasonableTransmissionTime_;
381  }
382 
383  /// Sets the reasonable transmission time - as the percentage from the `KeepAliveInterval` value.
385  SessionSettings& reasonableTransmissionTime(unsigned percentage);
386 
387  /// \return the size of the socket send buffer size.
388  ///
389  /// The default value is Default::SocketSendBufferSize.
392  return socketSendBufferSize_;
393  }
394 
395  /// Sets the size of the socket send buffer size.
396  ///
397  /// \param bufferSize the size of the socket send buffer size.
398  /// If SessionSettings::UseOsDefaultSocketBufferSize then the default operating system value is used.
400  SessionSettings& socketSendBufferSize(int bufferSize);
401 
402  /// \return the thread pool affinity.
405  return threadPoolAffinity_;
406  }
407 
408  /// Sets the thread pool affinity.
410  SessionSettings& threadPoolAffinity(const CpuIndexes & cpuIndexes);
411 
412  /// \return the thread pool priority.
415  return threadPoolPriority_;
416  }
417 
418  /// Sets the thread pool priority.
420  SessionSettings& threadPoolPriority(int priority);
421 
422  /// \return the thread pool policy.
425  return threadPoolPolicy_;
426  }
427 
428  /// Sets the thread pool policy.
430  SessionSettings& threadPoolPolicy(int policy);
431 
432  /// \return the value of the option to improve latency at the expense of message throughput (the `TCP_NODELAY` socket option).
433  ///
434  /// The default value is Default::TcpNoDelayOption.
437  return tcpNoDelayOption_;
438  }
439 
440  /// Sets the value of the option to improve latency at the expense of message throughput (the `TCP_NODELAY` socket option).
442  SessionSettings& tcpNoDelayOption(bool value);
443 
444  /// \return the size of the shared thread pool.
445  ///
446  /// The default value is Default::ThreadPoolSize.
449  return threadPoolSize_;
450  }
451 
452  /// Sets the size of the shared thread pool.
454  SessionSettings& threadPoolSize(unsigned numberOfThreads);
455 
456  /// \return the longest time in milliseconds the client system can remain silent before sending a message.
457  ///
458  /// The default value is Default::KeepAliveInterval.
461  return keepAliveInterval_;
462  }
463 
464  /// Sets the longest time in milliseconds the client system can remain silent before sending
465  /// a message.
466  ///
467  /// \note Allowed range is between `5000` - `60000`. Any value outside this range will be rejected.
469  SessionSettings& keepAliveInterval(unsigned milliseconds);
470 
471  /// \return The CoD timeout window in milliseconds.
472  ///
473  /// The default value is Default::CodTimeoutWindow.
476  return codTimeoutWindow_;
477  }
478 
479  /// Sets the CoD timeout window in milliseconds.
480  /// Gateway will not trigger CoD if the customer reconnects within the timeout window
481  /// (milliseconds) which starts when the triggering event is detected.
482  ///
483  /// \note Range is 0 (as soon as possible) to 60000.
485  SessionSettings& codTimeoutWindow(unsigned milliseconds);
486 
487  /// \return `true` if new messages are reported even when the message gap is detected,
488  /// and the reply on the `Retransmit Request` message is expected; otherwise - `false`.
489  ///
490  /// The default value is Default::ReportNewMessagesWhileWaitingForMissedMessages.
493  return reportNewMessagesWhileWaitingForMissedMessages_;
494  }
495 
496  /// Sets the option to report new messages even when the message gap is detected,
497  /// and the reply on the `Retransmit Request` message is expected.
499  SessionSettings& reportNewMessagesWhileWaitingForMissedMessages(bool report);
500 
501  /// Sets the range of the local ports to be used
503  SessionSettings& localPortRange(PortRange range);
504 
505  /// \return the range of the local ports to be used
508  return localPortRange_;
509  }
510 
511  /// Specifies the version of the message schema.
512  /// Allowed range is between Messaging::SchemaTraits::MinimalVersion - Messaging::SchemaTraits::Version.
513  /// The default value is Messaging::SchemaTraits::Version.
515  SessionSettings& messagingSchemaVersion(Messaging::SchemaVersion schema);
516 
517  /// \return the version of the message schema.
520  return messagingSchemaVersion_;
521  }
522 
523  /// \return the value of the option to use spin lock.
524  ///
525  /// The default value is `false`.
528  return useSpinLock_;
529  }
530 
531  /// Sets the value of the option to the option to use spin lock.
533  SessionSettings& useSpinLock(bool value);
534 
535  /// \return the value of the option to enable received data timestamp.
536  ///
537  /// The default value is `false`.
540  return enableRxTimestamp_;
541  }
542 
543  /// Sets the value of the option to enable received data timestamp.
544  /// \note available on Linux only
546  SessionSettings& enableRxTimestamp(bool value);
547 
548  /// Loads the settings from the given configuration file.
549  ///
550  /// \see Key
552  SessionSettings& load(const std::string& configFile);
553 
554  /// \return the human-friendly description.
556  std::string toString() const;
557 
558  /// Default session settings.
561  static const ThreadingModel::Enum ThreadingModelValue = ThreadingModel::Dedicated;
562  static const bool CreateLogFile = true;
563  static const int KeepAliveInterval = 30000;
564  static const int CodTimeoutWindow = 30000;
565  static const bool LogBeforeSending = true;
566  static const int SocketSendBufferSize = UseOsDefaultSocketBufferSize;
567  static const int SocketReceiveBufferSize = UseOsDefaultSocketBufferSize;
568  static const bool TcpNoDelayOption = true;
569  static const int ReceiveSpinningTimeout = 0;
570  static const int SendSpinningTimeout = 0;
571  static const char LicenseStore[] ;
572  static const unsigned LicenseAlertingDaysBeforeExpiration = 0;
573  static const char LogDir[];
574  static const char LogFileName[];
575  static const bool LocalTimeUsage = false;
576  static const unsigned MessageGrouping = 0;
577  static const int ReasonableTransmissionTime = 20;
578  static const int ReconnectAttempts = 3;
579  static const int ReconnectInterval = 180;
580  static const unsigned long long FileBasedStorageSegmentSize = 0;
581  static const bool IgnoreFileBasedStorageIntegrityErrors = false;
582  static const int ThreadPoolSize = 0;
583  static const bool ReportNewMessagesWhileWaitingForMissedMessages = false;
584  static const unsigned AsyncFileBasedStorageQueueMaxSize = UINT_MAX;
585  static const bool UseSpinLock = false;
586  static const bool EnableRxTimestamp = false;
587  };
588 
589  /// The keys that are used to load settings from the configuration file.
591  static const char * SessionId; ///< = "SessionId"
592  static const char * EnteringFirm; ///< = "EnteringFirm"
593  static const char * AccessKey; ///< = "AccessKey"
594  static const char * CancelOnDisconnectType; ///< = "CancelOnDisconnectType"
595  static const char * TradingSystemName; ///< = "TradingSystem.Name"
596  static const char * TradingSystemVersion; ///< = "TradingSystem.Version"
597 
598  static const char * AsyncFileBasedStorageQueueMaxSize; ///< = "AsyncFileBasedStorage.QueueMaxSize"
599  static const char * AsyncFileBasedStorageThreadAffinity; ///< = "AsyncFileBasedStorage.ThreadAffinity"
600  static const char * ThreadingModel; ///< = "ThreadingModel"
601  static const char * TcpNoDelayOption; ///< = "TcpNoDelayOption"
602  static const char * MessageGrouping; ///< = "MessageGrouping"
603  static const char * FileBasedStorageSegmentSize; ///< = "FileBasedStorageSegmentSize"
604  static const char * IgnoreFileBasedStorageIntegrityErrors; ///< = "IgnoreFileBasedStorageIntegrityErrors"
605  static const char * KeepAliveInterval; ///< = "KeepAliveInterval"
606  static const char * CodTimeoutWindow; ///< = "CodTimeoutWindow"
607  static const char * LicenseFile; ///< = "LicenseFile"
608  static const char * LicenseStore; ///< = "LicenseStore"
609  static const char * LicenseAlertingDaysBeforeExpiration; ///< = "LicenseAlertingDaysBeforeExpiration"
610  static const char * LocalNetworkInterface; ///< = "LocalNetworkInterface"
611  static const char * LogFileName; ///< = "Log.FileName"
612  static const char * LocalTimeUsage; ///< = "LocalTimeUsage"
613  static const char * LogBeforeSending; ///< = "Log.BeforeSending"
614  static const char * ReasonableTransmissionTime; ///< = "ReasonableTransmissionTime"
615  static const char * ReceiveSpinningTimeout; ///< = "ReceiveSpinningTimeout"
616  static const char * ReconnectAttempts; ///< = "Reconnect.Attempts"
617  static const char * ReconnectInterval; ///< = "Reconnect.Interval"
618  static const char * SendSpinningTimeout; ///< = "SendSpinningTimeout"
619  static const char * ThreadPoolAffinity; ///< = "ThreadPool.Affinity"
620  static const char * ThreadPoolSize; ///< = "ThreadPool.Size"
621  static const char * ThreadPoolPriority; ///< = "ThreadPool.Priority"
622  static const char * ThreadPoolPolicy; ///< = "ThreadPool.Policy"
623  static const char * SocketReceiveBufferSize; ///< = "Socket.ReceiveBufferSize"
624  static const char * SocketSendBufferSize; ///< = "Socket.SendBufferSize"
625  static const char * StorageDirectory; ///< = "Log.Directory"
626  static const char * ReportNewMessagesWhileWaitingForMissedMessages; ///< = "ReportNewMessagesWhileWaitingForMissedMessages"
627  static const char * MessagingSchemaVersion; ///< = "MessagingSchemaVersion"
628  static const char * LocalPortRange; ///< = "LocalPortRange"
629  static const char * UseSpinLock; ///< = "UseSpinLock"
630  static const char * EnableRxTimestamp; ///< = "EnableRxTimestamp"
631  };
632 
633 private:
634  void processLicenseStores(const std::string& licenseStore);
635 
636  std::string accessKey_;
637 
638  unsigned asyncFileBasedStorageQueueMaxSize_;
639 
640  CpuIndexes asyncFileBasedStorageThreadAffinity_;
641 
642  bool createEngineLogFile_;
643 
644  Messaging::UInt64 fileBasedStorageSegmentSize_;
645 
646  Messaging::UInt32 enteringFirm_;
647 
648  Messaging::CancelOnDisconnectType::Enum cancelOnDisconnectType_;
649 
650  bool ignoreFileBasedStorageIntegrityErrors_;
651 
652  unsigned keepAliveInterval_;
653 
654  unsigned codTimeoutWindow_;
655 
656  unsigned licenseAlertingDaysBeforeExpiration_;
657 
658  std::string licenseFilePath_;
659 
660  LicenseStores licenseStores_;
661 
662  std::string localNetworkInterface_;
663 
664  bool localTimeUsage_;
665 
666  bool logBeforeSending_;
667 
668  std::string logFileName_;
669 
670  unsigned messageGrouping_;
671 
672  unsigned reasonableTransmissionTime_;
673 
674  int receiveSpinningTimeout_;
675 
676  unsigned reconnectAttempts_;
677 
678  unsigned reconnectInterval_;
679 
680  bool reportNewMessagesWhileWaitingForMissedMessages_;
681 
682  int sendSpinningTimeout_;
683 
684  Messaging::SessionID sessionId_;
685 
686  int socketReceiveBufferSize_;
687 
688  int socketSendBufferSize_;
689 
690  std::string storageDirectory_;
691 
692  bool tcpNoDelayOption_;
693 
694  ThreadingModel::Enum threadingModel_;
695 
696  CpuIndexes threadPoolAffinity_;
697 
698  int threadPoolPolicy_;
699 
700  int threadPoolPriority_;
701 
702  unsigned threadPoolSize_;
703 
704  std::string tradingSystemName_;
705 
706  std::string tradingSystemVersion_;
707 
708  std::pair<Port, Port> localPortRange_;
709 
710  Messaging::SchemaVersion messagingSchemaVersion_;
711 
712  bool useSpinLock_;
713 
714  bool enableRxTimestamp_;
715 };
716 
717 }
718 }
719 }
const std::string & tradingSystemName() const noexcept
unsigned reconnectAttempts() const noexcept
static const char * ReconnectInterval
= "Reconnect.Interval"
unsigned asyncFileBasedStorageQueueMaxSize() const noexcept
Messaging::CancelOnDisconnectType::Enum cancelOnDisconnectType() const noexcept
static const char * MessageGrouping
= "MessageGrouping"
std::pair< Port, Port > PortRange
Definition: Defines.h:74
const std::string & tradingSystemVersion() const noexcept
Messaging::SchemaVersion messagingSchemaVersion() const noexcept
bool localTimeUsage() const noexcept
bool ignoreFileBasedStorageIntegrityErrors() const noexcept
static const char * FileBasedStorageSegmentSize
= "FileBasedStorageSegmentSize"
static const int UseOsDefaultSocketBufferSize
Specifies the usage of the operating system default socket buffer size.
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
Definition: SchemaTraits.h:30
#define ONIXS_B3_BOE_NOTHROW
Definition: Compiler.h:182
static const char * KeepAliveInterval
= "KeepAliveInterval"
bool reportNewMessagesWhileWaitingForMissedMessages() const noexcept
const std::string & logFileName() const noexcept
unsigned messageGrouping() const noexcept
std::string toString() const
#define ONIXS_B3_BOE_EXPORTED
Definition: Compiler.h:181
SessionSettings & licenseStore(const std::string &value)
Sets the path to the folder that contains license file(s).
static const char * LicenseAlertingDaysBeforeExpiration
= "LicenseAlertingDaysBeforeExpiration"
static const char * LocalNetworkInterface
= "LocalNetworkInterface"
Messaging::SessionID sessionId() const noexcept
static const char * TradingSystemName
= "TradingSystem.Name"
static const char * ThreadPoolAffinity
= "ThreadPool.Affinity"
static const char * SocketReceiveBufferSize
= "Socket.ReceiveBufferSize"
SessionSettings & addLicenseStore(const std::string &value)
Adds the path to the folder that contains license file(s).
UInt32 SessionID
Client connection identification on the gateway assigned by B3.
Definition: Fields.h:103
unsigned keepAliveInterval() const noexcept
static const char * TcpNoDelayOption
= "TcpNoDelayOption"
static const char * LicenseStore
= "LicenseStore"
unsigned codTimeoutWindow() const noexcept
unsigned reconnectInterval() const noexcept
static const char * TradingSystemVersion
= "TradingSystem.Version"
int socketReceiveBufferSize() const noexcept
const std::string & localNetworkInterface() const noexcept
Definition: Defines.h:40
#define ONIXS_B3_BOE_NODISCARD
Definition: Compiler.h:191
static const char * CodTimeoutWindow
= "CodTimeoutWindow"
static const char * IgnoreFileBasedStorageIntegrityErrors
= "IgnoreFileBasedStorageIntegrityErrors"
unsigned receiveSpinningTimeout() const noexcept
static const char * LocalPortRange
= "LocalPortRange"
std::set< CpuIndex > CpuIndexes
Definition: Defines.h:73
unsigned sendSpinningTimeout() const noexcept
static const char * AccessKey
= "AccessKey"
Messaging::UInt64 fileBasedStorageSegmentSize() const noexcept
static const char * StorageDirectory
= "Log.Directory"
ThreadingModel::Enum threadingModel() const noexcept
const CpuIndexes & asyncFileBasedStorageThreadAffinity() const noexcept
static const char * EnteringFirm
= "EnteringFirm"
bool useSpinLock() const noexcept
int threadPoolPolicy() const noexcept
unsigned licenseAlertingDaysBeforeExpiration() const noexcept
static const char * ThreadPoolPolicy
= "ThreadPool.Policy"
static const char * ThreadPoolPriority
= "ThreadPool.Priority"
Criteria used to initiate cancel on disconnect mechanism by the gateway.
Definition: Fields.h:1417
static const char * LicenseFile
= "LicenseFile"
SessionSettings & load(const std::string &configFile)
Loads the settings from the given configuration file.
static const char * ThreadPoolSize
= "ThreadPool.Size"
Messaging::UInt32 enteringFirm() const noexcept
static const char * ReportNewMessagesWhileWaitingForMissedMessages
= "ReportNewMessagesWhileWaitingForMissedMessages"
The keys that are used to load settings from the configuration file.
static const char * AsyncFileBasedStorageThreadAffinity
= "AsyncFileBasedStorage.ThreadAffinity"
std::vector< std::string > LicenseStores
Folders that contain license file(s).
int socketSendBufferSize() const noexcept
static const char * SessionId
= "SessionId"
static const char * MessagingSchemaVersion
= "MessagingSchemaVersion"
SessionSettings & licenseAlertingDaysBeforeExpiration(unsigned days)
Sets the number of days to alert before the license expiration.
SessionSettings & resetToDefaults()
Resets the settings to the default values.
bool logBeforeSending() const noexcept
bool tcpNoDelayOption() const noexcept
const CpuIndexes & threadPoolAffinity() const noexcept
static const char * LogBeforeSending
= "Log.BeforeSending"
static const char * ReasonableTransmissionTime
= "ReasonableTransmissionTime"
static const char * AsyncFileBasedStorageQueueMaxSize
= "AsyncFileBasedStorage.QueueMaxSize"
unsigned threadPoolSize() const noexcept
const std::string & storageDirectory() const noexcept
static const char * LogFileName
= "Log.FileName"
static const char * ThreadingModel
= "ThreadingModel"
Each session has a sender thread and a receiving thread.
const std::string & accessKey() const noexcept
unsigned reasonableTransmissionTime() const noexcept
static const char * EnableRxTimestamp
= "EnableRxTimestamp"
static const char * SendSpinningTimeout
= "SendSpinningTimeout"
bool enableRxTimestamp() const noexcept
Enum
Criteria used to initiate cancel on disconnect mechanism by the gateway.
Definition: Fields.h:1422
static const char * CancelOnDisconnectType
= "CancelOnDisconnectType"
int threadPoolPriority() const noexcept
static const char * LocalTimeUsage
= "LocalTimeUsage"
static const char * ReconnectAttempts
= "Reconnect.Attempts"
static const char * UseSpinLock
= "UseSpinLock"
PortRange localPortRange() const noexcept
const LicenseStores & licenseStores() const noexcept
static const char * SocketSendBufferSize
= "Socket.SendBufferSize"
static const char * ReceiveSpinningTimeout
= "ReceiveSpinningTimeout"