OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Session.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 <string>
23#include <set>
24#include <vector>
25#include <utility>
26#include <iosfwd>
27#include <limits>
28
32
33
35
44
46
48
51
52
53namespace OnixS {
54namespace FIX {
60
63 enum Enum {
66
69 };
70};
71
72namespace Core {
73namespace Messaging {
74class Message;
75}
76}
77
78template<typename MsgType>
80{
82 typedef std::vector<FlatMessage*> MsgBatchType;
83 typedef std::vector<OnixS::FIX::Core::Messaging::Extras::FlatMessage*> CoreMsgBatchType;
84};
85
86template<>
88{
90 typedef std::vector<Message*> MsgBatchType;
91 typedef std::vector<OnixS::FIX::Core::Messaging::Message*> CoreMsgBatchType;
92};
93
98{
99public:
111 const std::string & senderCompId,
112 const std::string & targetCompId,
113 const Dictionary & dictionary,
114 ISessionListener * listener,
116 ISessionStorage * storage = nullptr);
117
130 ISessionReactor * reactor,
131 const std::string & senderCompId,
132 const std::string & targetCompId,
133 const Dictionary & dictionary,
134 ISessionListener * listener,
136 ISessionStorage * storage = nullptr);
137
150 const std::string & senderCompId,
151 const std::string & targetCompId,
152 const Dictionary & dictionary,
153 bool keepSequenceNumbersAfterLogout,
156 ISessionStorage * storage = nullptr);
157
158
172 ISessionReactor * reactor,
173 const std::string & senderCompId,
174 const std::string & targetCompId,
175 const Dictionary & dictionary,
176 bool keepSequenceNumbersAfterLogout,
179 ISessionStorage * storage = nullptr);
180
194 const std::string & senderCompId,
195 const std::string & targetCompId,
196 const Dictionary & dictionary,
197 bool keepSequenceNumbersAfterLogout,
199 const std::string & customSessionKey,
201 ISessionStorage * storage = nullptr);
202
217 ISessionReactor * reactor,
218 const std::string & senderCompId,
219 const std::string & targetCompId,
220 const Dictionary & dictionary,
221 bool keepSequenceNumbersAfterLogout,
223 const std::string & customSessionKey,
225 ISessionStorage * storage = nullptr);
226
231
239 Session & clearOutboundQueue(bool removeFragmentedPacket = false);
240
247
254
261
268 int listenPort() const;
269
280
287 std::string listenNetworkInterfaceAndPort() const;
288
302 Session & listenNetworkInterfaceAndPort(const std::string & networkInterfaceAndPort);
303
309 std::string localNetworkInterface() const;
310
317
323 unsigned short localPort() const;
327 typedef std::pair<unsigned short, unsigned short> LocalPortRange;
328
335
342
347 bool tcpNoDelayOption() const;
348
352 Session & tcpNoDelayOption(bool improveLatency = true);
353
360
366
372
377
383
388
394
399
405
410
416
421
427
432
438
443
449
454
459 bool validateChecksum() const;
460
465
470 unsigned messageGrouping() const;
471
475 Session & messageGrouping(unsigned numberOfMessagesToGroup);
476
481
486
490 bool useSpinLock() const;
491
495 Session & useSpinLock(bool value);
496
502
513
518
523 int reconnectAttempts() const;
524
529
534 int reconnectInterval() const;
535
542
548
556
562
567
573
579 std::string sslCertificateFile() const;
580
588 Session & sslCertificateFile(const std::string & file);
589
595 std::string sslPrivateKeyFile() const;
596
604 Session & sslPrivateKeyFile(const std::string & file);
605
612
619
627 Session & sslVerifyPeer(bool verify);
628
636 bool sslVerifyPeer() const;
637
645 Session & sslClientSni(const std::string & hostName);
646
650 const std::string & sslClientSni() const;
651
657 Session & sslCaFile(const std::string & value);
658
664 std::string sslCaFile() const;
665
672
679
686
693
704
715 Session & logonAsInitiator(const std::string & host, int port, bool setResetSeqNumFlag);
716
727 Session & logonAsInitiator(const std::string & host, int port);
728
736 Session & logonAsInitiator(const std::string & host, int port, int heartbeatIntervalSec);
737
745 Session & logonAsInitiator(const std::string & host, int port, int heartbeatIntervalSec, bool setResetSeqNumFlag);
746
754 Session & logonAsInitiator(const std::string & host, int port, int heartbeatIntervalSec, Message * customLogonMsg);
755
763 Session & logonAsInitiator(const std::string & host, int port, int heartbeatIntervalSec, Message * customLogonMsg, bool setResetSeqNumFlag);
764
772 Threading::SharedFuture<void> logonAsInitiatorAsync(const std::string & host, int port, int heartbeatIntervalSec, Message * customLogonMsg, bool setResetSeqNumFlag);
773
788
805 Session & logout(const std::string & text);
806
825
841 Session & logout(Message * customLogoutMessage);
842 Session & logout(FlatMessage * customLogoutMessage);
843
862
869
895
920
924 template<typename MsgType> class MsgBatch;
925
927 {
928 typedef MsgBatchTraits<Message> MBT;
929 typedef MsgBatchTraits<FlatMessage> SBT;
930
931 static void init(MBT::CoreMsgBatchType & coreBatch);
932 static void init(SBT::CoreMsgBatchType & coreBatch);
933 static void add(MBT::MsgBatchType & batch, MBT::CoreMsgBatchType & coreBatch, MBT::MessagePtr & msg);
934 static void add(SBT::MsgBatchType & batch, SBT::CoreMsgBatchType & coreBatch, SBT::MessagePtr & msg);
935 static void clear(MBT::MsgBatchType & batch);
936 static void clear(SBT::MsgBatchType & batch);
937
938 template<typename MsgType> friend class MsgBatch;
939 };
940
941 template<typename MsgType>
942 class MsgBatch
943 {
944 typedef MsgBatchTraits<MsgType> Traits;
945
946 friend class Session;
947
948 typename Traits::MsgBatchType batch_;
949 typename Traits::CoreMsgBatchType coreBatch_;
950
951 MsgBatch(const MsgBatch&);
952 MsgBatch & operator=(const MsgBatch&);
953
954 public:
955
957 typedef typename Traits::MsgBatchType::iterator iterator;
958 typedef typename Traits::MsgBatchType::const_iterator const_iterator;
959
960 MsgBatch() { MsgBatchHelper::init(coreBatch_); }
961 ~MsgBatch() { MsgBatchHelper::clear(batch_); }
962
963 void add(MessagePtr & msg) { MsgBatchHelper::add(batch_, coreBatch_, msg); }
964
965 MsgType & operator[](size_t index) { return *batch_[index]; }
966 const MsgType & operator[](size_t index) const { return *batch_[index]; }
967
968 size_t size() const { return batch_.size(); }
969
970 const_iterator begin() const { return batch_.begin(); }
971 iterator begin() { return batch_.begin(); }
972
973 const_iterator end() const { return batch_.end(); }
974 iterator end() { return batch_.end(); }
975 };
976
980
1011 Session & send(MessageBatch & msgs, size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
1012 Session & send(FlatMessageBatch & msgs, size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
1013
1037 Session & send(FlatMessageBatch & msgs, SessionSendMode::Enum mode, size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
1038
1067
1102 Session & sendAsIs(FlatMessageBatch & msgs, size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
1103
1111
1120 size_t tryThrottle(bool resetWhenDelay = false);
1121
1130 Session & throttlingLimit(size_t messagesCount, size_t intervalInMs = 1000);
1131
1140 Session & warmUp(FlatMessage* msg, int warmupFlags = 0);
1141
1151 static bool checkWarmupFlags(int warmupFlags, unsigned short baseListenPort = 5000, const std::string & localNetworkInterface = "127.0.0.1");
1152
1158 void preFill(Message & msg) const;
1159
1169 void preFill(FlatMessage & msg) const;
1170 void preFill(FlatMessageBatch & msgs) const;
1171
1178
1184 operator const std::string & () const;
1185
1191 const std::string & storageId() const;
1192
1212 Session & flushSessionStorage(bool syncData = false);
1213
1222 std::string counterpartyHost() const;
1223
1229 std::string counterpartyIpAddress() const;
1230
1236 size_t counterpartyPort() const;
1237
1243 const std::string & customKey() const;
1244
1250 size_t outboundQueueBytes() const;
1251
1256
1262
1267
1273
1278
1282 typedef std::set<std::string> InboundMessageLogFilter;
1283
1290
1297
1301 typedef std::set<std::string> OutboundMessageLogFilter;
1302
1309
1316
1323 bool logBeforeSending() const;
1324
1331
1338
1345
1352
1359
1364 static const unsigned int ResendRequestMaximumRangeNoLimit;
1365
1376
1386
1393
1400 size_t resendingQueueSize() const;
1401
1408
1414 size_t resendingBatchSize() const;
1415
1422
1428 const std::string & senderCompId() const;
1429
1435
1443
1449
1454
1460
1466 const std::string & targetCompId() const;
1467
1472
1477
1482
1487
1492
1497
1502
1507
1512
1517
1522
1527
1532
1537
1542
1547
1555 Message * findSentMessage(SequenceNumber messageSequenceNumber);
1557
1567
1583
1588
1594
1599
1610
1615
1621
1626
1633
1638
1643
1648
1656
1662
1669
1676
1683
1692
1703
1709 std::string senderSubId() const;
1710
1716 Session & senderSubId(const std::string & value);
1717
1723 std::string targetSubId() const;
1724
1730 Session & targetSubId(const std::string & value);
1731
1737 std::string senderLocationId() const;
1738
1744 Session & senderLocationId(const std::string & value);
1745
1751 std::string targetLocationId() const;
1752
1758 Session & targetLocationId(const std::string & value);
1759
1764
1770
1776 std::string threadNameSuffix() const;
1777
1788 Session & threadNameSuffix(const std::string & value);
1789
1803 Session & sendTestRequest(const std::string & testReqId = "", const TimeSpan & timeout = TimeSpan::zero());
1804
1820
1834 Session & sendReject(SequenceNumber refSeqNumber, const std::string & text, const std::string & sessionRejectReason = "");
1835
1843
1849 std::string toString() const;
1850
1855
1862
1869
1878 Session & logDirectory(const std::string & value);
1879
1885 const std::string & logDirectory() const;
1886
1897 Session & resendTimeout(const TimeSpan & timeout);
1898
1905
1909 typedef std::vector<Tag> ScrambledFields;
1910
1917
1922
1930
1935 size_t sendQueueMaxSize() const;
1936
1942 Session & connectTimeout(const TimeSpan & timeout);
1943
1950
1958
1966
1973 int sendBufferSize() const;
1974
1982
1989 bool enableRxTimestamp() const;
1990
1998
2006
2011 {
2013 :host(), port(), username(), password()
2014 {}
2015
2016 ProxySettings(const std::string & proxyHost, int proxyPort, const std::string & proxyUsername = std::string(), const std::string & proxyPassword = std::string())
2017 :host(proxyHost), port(proxyPort), username(proxyUsername), password(proxyPassword)
2018 {}
2019
2020 std::string host;
2021 int port;
2022 std::string username;
2023 std::string password;
2024 };
2025
2030
2035
2040
2045
2046 struct Impl;
2047
2048private:
2049 void init(
2050 const std::string & senderCompId,
2051 const std::string & targetCompId,
2052 const Dictionary & dictionary,
2053 ISessionListener * listener,
2054 bool keepSequenceNumbersAfterLogout,
2055 SessionStorageType::Enum storageType,
2056 ISessionStorage * storage,
2057 const std::string & customSessionKey,
2058 ISessionReactor * reactor);
2059
2060 Impl * impl_;
2061
2062 friend class Engine::Impl;
2063};
2064
2067std::ostream & operator << (std::ostream & os, const Session & session);
2068}
2069}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
The immutable secure string.
Identifies the FIX messages dictionary.
Definition Dictionary.h:132
The FIX Engine.
Definition Engine.h:43
Receives synchronous session callbacks; see Callback Safety for restrictions and data lifetime.
The session's network stack reactor interface.
The session's pluggable storage.
const_iterator begin() const
Definition Session.h:970
const MsgType & operator[](size_t index) const
Definition Session.h:966
Traits::MsgBatchType::const_iterator const_iterator
Definition Session.h:958
MsgType & operator[](size_t index)
Definition Session.h:965
void add(MessagePtr &msg)
Definition Session.h:963
const_iterator end() const
Definition Session.h:973
Traits::MessagePtr MessagePtr
Definition Session.h:956
Traits::MsgBatchType::iterator iterator
Definition Session.h:957
InboundMessageLogFilter inboundMessageLogFilter() const
Session & send(MessageBatch &msgs, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
SequenceNumber inSeqNum() const
Session & send(FlatMessageBatch &msgs, SessionSendMode::Enum mode, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
std::string localNetworkInterface() const
Session & updateSendingTimeField(bool specify)
Session & sendResendRequestOnEachMessageGap(bool send)
bool validateSequenceNumbers() const
SslProtocolMinMaxVersion::Enum sslMaxProtocolVersion() const
Session & sendingThreadAffinity(const OnixS::Threading::CpuIndexes &cpuIndexes)
int heartbeatIntervalSec() const
Session & sendSpinningTimeoutUsec(int usec)
bool updateSendingTimeField() const
Session & logOutboundMessages(bool value)
Session & shutdown()
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=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=nullptr)
int reasonableTransmissionTime() const
Session & receivingThreadAffinity(const OnixS::Threading::CpuIndexes &cpuIndexes)
Session & throttle()
TimeSpan resendTimeout() const
Session & targetSubId(const std::string &value)
int listenPort() const
Session & validateSequenceNumbers(bool value)
MsgBatchTraits< Message >::MsgBatchType findSentMessages(SequenceNumber beginSequenceNumber, SequenceNumber endSequenceNumber)
Session & sendTestRequest(const std::string &testReqId="", const TimeSpan &timeout=TimeSpan::zero())
Session & reconnectInterval(int value)
int reconnectInterval() const
const OnixS::Threading::CpuIndexes & sendingThreadAffinity() const
Session & sslMinProtocolVersion(SslProtocolMinMaxVersion::Enum version)
Session & warmUp(FlatMessage *msg, int warmupFlags=0)
std::string toString() const
Session & sendingThreadAffinity(const OnixS::Threading::CpuIndex cpuIndex)
friend class Engine::Impl
Definition Session.h:2062
Session & messageGrouping(unsigned numberOfMessagesToGroup)
MessageMode::Enum messageMode() const
Session & breakConnection()
bool ignoreLessThanExpectedSequenceNumber() const
std::string sslPrivateKeyFile() const
size_t sendQueueMaxSize() const
Session & sslClientSni(const std::string &hostName)
Session & inSeqNum(SequenceNumber seqNum)
int reconnectAttempts() const
Session & logBeforeSending(bool value)
Session & proxySettings(const ProxySettings &settings)
Session & scrambleLogonFields(const ScrambledFields &fields)
Session & sendAsIs(FlatMessageBatch &msgs, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
Session & resendRequestMaximumRange(int range)
Session & sslCaFile(const std::string &value)
Session & logout()
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=nullptr)
bool validateFieldValues() const
bool requestOnlyMissedMessages() const
Session(ISessionReactor *reactor, const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, ISessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=nullptr)
Session & clearOutboundQueue(bool removeFragmentedPacket=false)
bool enableRxTimestamp() const
std::string listenNetworkInterfaceAndPort() const
bool considerRejectOnResendRequestAsGapFill() const
Session & supportNextExpectedMsgSeqNum(bool support)
std::string senderLocationId() const
OutboundMessageLogFilter outboundMessageLogFilter() const
Session & resetSeqNumViaLogonExchange()
Session & validateFieldValues(bool)
Dictionary dictionary() const
Session & validateEmptyFieldValues(bool)
Session & useSpinLock(bool value)
Session & outboundMessageLogFilter(const OutboundMessageLogFilter &filter)
std::vector< Tag > ScrambledFields
Definition Session.h:1909
Session & socketOptions(const OnixS::Sockets::SocketOptions &options)
Session & validateUnknownMessages(bool)
Session & listenPort(int listenPort)
size_t outboundQueueBytes() const
bool reportNewMessagesWhileWaitingForMissedMessages() const
Session & localPortRange(LocalPortRange portRange)
Session & logonAsAcceptor()
SslProtocolMinMaxVersion::Enum sslMinProtocolVersion() const
Session & throttlingLimit(size_t messagesCount, size_t intervalInMs=1000)
Session & tcpNoDelayOption(bool improveLatency=true)
Session & sslCertificateFile(const std::string &file)
size_t resendingQueueSize() const
MsgBatchTraits< FlatMessage >::MsgBatchType findSentFlatMessages(SequenceNumber beginSequenceNumber, SequenceNumber endSequenceNumber)
bool validateRepeatingGroupEntryCount() const
static const unsigned int ResendRequestMaximumRangeNoLimit
Definition Session.h:1364
int receiveBufferSize() const
bool validateChecksum() const
Session & sendReject(SequenceNumber refSeqNumber, const std::string &text, const std::string &sessionRejectReason="")
Session & unregisterListener(ISessionListener *listener)
Session & logonAsInitiator(const std::string &host, int port, int heartbeatIntervalSec, bool setResetSeqNumFlag)
Session & logonAsInitiator(const std::string &host, int port, int heartbeatIntervalSec, Message *customLogonMsg, bool setResetSeqNumFlag)
Session & sendAsIs(FlatMessage *msg)
void messageMode(MessageMode::Enum mode)
Session & enableRxTimestamp(bool value)
int sendBufferSize() const
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=nullptr)
Session & sendingTimeFormat(TimestampFormat::Enum format)
Session & logonAsInitiator(const std::string &host, int port)
int receivingThreadPolicy() const
Session & receiveSpinningTimeoutUsec(int usec)
std::set< std::string > OutboundMessageLogFilter
Definition Session.h:1301
Session & requestOnlyMissedMessages(bool request)
size_t incomingMessageGapQueueMaximumSize() const
Cryptography::SecureString sslPrivateKeyPassword() const
Session & send(FlatMessageBatch &msgs, size_t maxPacketSize=(std::numeric_limits< size_t >::max)())
Session & sendingThreadPolicy(int policy)
Session & validateRepeatingGroupEntryCount(bool)
size_t tryThrottle(bool resetWhenDelay=false)
Session & logout(FlatMessage *customLogoutMessage)
bool sendResendRequestOnEachMessageGap() const
Session & sendLogoutOnException(bool sendLogoutOnException)
EncryptionMethod::Enum encryptionMethod() const
const OnixS::Threading::CpuIndexes & receivingThreadAffinity() const
const std::string & senderCompId() const
const std::string & sslClientSni() const
Session & flushSessionStorage(bool syncData=false)
Session & resendTimeout(const TimeSpan &timeout)
std::pair< unsigned short, unsigned short > LocalPortRange
Definition Session.h:327
std::string sslCaFile() const
Session & logInboundMessages(bool value)
static const OnixS::Sockets::Handle InvalidSocketHandle
Definition Session.h:1854
Threading::SharedFuture< void > logoutAsync(FlatMessage *customLogoutMessage)
bool logInboundMessages() const
ScrambledFields scrambleLogonFields() const
Session & logout(Message *customLogoutMessage)
Session & logonAsInitiator(const std::string &host, int port, int heartbeatIntervalSec, Message *customLogonMsg)
Session & send(FlatMessage *msg)
Session & threadingModel(ThreadingModel::Enum value)
FlatMessageBatch SerializedMessageBatch
Definition Session.h:979
std::string targetLocationId() const
bool sslVerifyPeer() const
unsigned short localPort() const
Timestamp creationTime() const
Session & logonAsInitiator(const std::string &host, int port, int heartbeatIntervalSec)
std::string threadNameSuffix() const
Session & sslPrivateKeyFile(const std::string &file)
bool logOutboundMessages() const
const std::string & logDirectory() const
Session & receivingThreadPriority(int priority)
ThreadingModel::Enum threadingModel() const
Session & validateRequiredFields(bool)
void preFill(FlatMessage &msg) const
Session & sendBufferSize(int value)
const std::string & customKey() const
Session & validateDuplicatedField(bool)
LocalPortRange localPortRange() const
Session & sendQueueMaxSize(size_t size)
Session & logout(const std::string &text)
Session & logonAsInitiator(const std::string &host, int port, bool setResetSeqNumFlag)
unsigned messageGrouping() const
Session & incomingMessageGapQueueMaximumSize(size_t maxSize)
int sendingThreadPriority() const
Session & receiveBufferSize(int value)
Message * findSentMessage(SequenceNumber messageSequenceNumber)
bool resetLocalSequenceNumbersOnLogon() const
Session & validateUnknownFields(bool)
Session & unregisterAllListeners()
Session & ignoreLessThanExpectedSequenceNumber(bool ignore)
SequenceNumber outSeqNum() const
int sendSpinningTimeout() const
Session & threadNameSuffix(const std::string &value)
MsgBatch< Message > MessageBatch
Definition Session.h:977
Session & targetLocationId(const std::string &value)
bool specifyLastMsgSeqNumProcessed() const
Session & sslMaxProtocolVersion(SslProtocolMinMaxVersion::Enum version)
Session & specifyLastMsgSeqNumProcessed(bool specify)
FlatMessage * findSentFlatMessage(SequenceNumber messageSequenceNumber)
Session & listenNetworkInterfaceAndPort(const std::string &networkInterfaceAndPort)
Session & senderSubId(const std::string &value)
void preFill(Message &msg) const
OnixS::Sockets::Handle socketHandle()
Session & resetLocalSequenceNumbersOnLogon(bool reset)
size_t resendingBatchSize() const
Session & receivingThreadPolicy(int policy)
std::string counterpartyHost() const
SessionState::Enum state() const
bool logBeforeSending() const
Threading::SharedFuture< void > logoutAsync(const std::string &text)
MsgBatch< FlatMessage > FlatMessageBatch
Definition Session.h:978
std::string senderSubId() const
Session & sendResendRequest(SequenceNumber beginSeqNumber)
Session & outSeqNum(SequenceNumber seqNum)
Session(const std::string &senderCompId, const std::string &targetCompId, const Dictionary &dictionary, ISessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, ISessionStorage *storage=nullptr)
Session & inboundMessageLogFilter(const InboundMessageLogFilter &filter)
TimeSpan connectTimeout() const
SessionRole::Enum role() const
Threading::SharedFuture< void > logonAsInitiatorAsync(const std::string &host, int port, int heartbeatIntervalSec, Message *customLogonMsg, bool setResetSeqNumFlag)
Session & resendingQueueSize(size_t value)
Session & send(FlatMessage *msg, SessionSendMode::Enum mode)
Session & validateRepeatingGroupLeadingTag(bool)
Session & reasonableTransmissionTime(int value)
Session & encryptionMethod(EncryptionMethod::Enum newEncryptionMethod)
bool validateRequiredFields() const
bool sendLogoutOnException() const
int receiveSpinningTimeout() const
int receivingThreadPriority() const
Session & receivingThreadAffinity(const OnixS::Threading::CpuIndex cpuIndex)
Session & reconnectAttempts(int value)
Session & senderLocationId(const std::string &value)
Session & logDirectory(const std::string &value)
const std::string & targetCompId() const
Threading::SharedFuture< void > logoutAsync(Message *customLogoutMessage)
const std::string & storageId() const
std::string targetSubId() const
ProxySettings proxySettings() const
bool validateDuplicatedField() const
Session & sslPrivateKeyPassword(const Cryptography::SecureString &password)
Session & validateChecksum(bool)
Session & connectTimeout(const TimeSpan &timeout)
Session & reportNewMessagesWhileWaitingForMissedMessages(bool report)
size_t counterpartyPort() const
Session & registerListener(ISessionListener *listener)
Session & resendingBatchSize(size_t value)
Session & sslVerifyPeer(bool verify)
int resendRequestMaximumRange() const
Session & localNetworkInterface(const std::string &localNetworkInterface)
std::string sslCertificateFile() const
bool validateEmptyFieldValues() const
void preFill(FlatMessageBatch &msgs) const
static const int UndefinedPriorityAndPolicy
Definition Session.h:1506
std::set< std::string > InboundMessageLogFilter
Definition Session.h:1282
static bool checkWarmupFlags(int warmupFlags, unsigned short baseListenPort=5000, const std::string &localNetworkInterface="127.0.0.1")
bool supportNextExpectedMsgSeqNum() const
int sendingThreadPolicy() const
bool validateUnknownMessages() const
std::string counterpartyIpAddress() const
bool tcpNoDelayOption() const
Session & considerRejectOnResendRequestAsGapFill(bool consider)
bool useSpinLock() const
Session & resetLocalSequenceNumbers()
bool validateRepeatingGroupLeadingTag() const
Session & sendingThreadPriority(int priority)
Session & send(Message *msg)
bool validateUnknownFields() const
The time span related functionality.
Definition TimeSpan.h:94
static TimeSpan zero()
The zero value of the time span.
The timestamps related functionality.
Definition Timestamp.h:92
ONIXS_FIXENGINE_API std::ostream & operator<<(std::ostream &os, const FlatMessage &message)
The stream output.
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)
unsigned int SequenceNumber
Alias for the sequence number.
std::vector< SocketOption > SocketOptions
Storage type of socket options.
Definition Definitions.h:67
int Handle
Type alias for socket handle.
Definition Definitions.h:50
size_t CpuIndex
Logical processors that a thread is allowed to run on (first logical CPU has index 0).
Definition Thread.h:31
std::set< CpuIndex > CpuIndexes
Definition Thread.h:32
The session message mode.
Definition Session.h:62
@ FlatMessage
The FlatMessage class is used in inbound callbacks.
Definition Session.h:68
@ Message
The default mode. The Message class is used in inbound callbacks.
Definition Session.h:65
std::vector< Message * > MsgBatchType
Definition Session.h:90
PtrTraits< Message >::UniquePtr MessagePtr
Definition Session.h:89
std::vector< OnixS::FIX::Core::Messaging::Message * > CoreMsgBatchType
Definition Session.h:91
std::vector< FlatMessage * > MsgBatchType
Definition Session.h:82
std::vector< OnixS::FIX::Core::Messaging::Extras::FlatMessage * > CoreMsgBatchType
Definition Session.h:83
PtrTraits< MsgType >::UniquePtr MessagePtr
Definition Session.h:81
@ FileBased
The file based storage. The session's state and messages are persisted to the file system.
ProxySettings(const std::string &proxyHost, int proxyPort, const std::string &proxyUsername=std::string(), const std::string &proxyPassword=std::string())
Definition Session.h:2016
std::unique_ptr< T > UniquePtr
Definition Definitions.h:29