78 template<
typename MsgType>
83 typedef std::vector<OnixS::FIX::Core::Messaging::Extras::FlatMessage*>
CoreMsgBatchType;
111 const std::string & senderCompId,
112 const std::string & targetCompId,
131 const std::string & senderCompId,
132 const std::string & targetCompId,
150 const std::string & senderCompId,
151 const std::string & targetCompId,
153 bool keepSequenceNumbersAfterLogout,
173 const std::string & senderCompId,
174 const std::string & targetCompId,
176 bool keepSequenceNumbersAfterLogout,
194 const std::string & senderCompId,
195 const std::string & targetCompId,
197 bool keepSequenceNumbersAfterLogout,
199 const std::string & customSessionKey,
218 const std::string & senderCompId,
219 const std::string & targetCompId,
221 bool keepSequenceNumbersAfterLogout,
223 const std::string & customSessionKey,
239 Session & clearOutboundQueue(
bool removeFragmentedPacket =
false);
267 int listenPort()
const;
274 Session & listenPort(
int listenPort);
281 std::string localNetworkInterface()
const;
288 Session & localNetworkInterface(
const std::string & localNetworkInterface);
295 unsigned short localPort()
const;
306 LocalPortRange localPortRange()
const;
313 Session & localPortRange(LocalPortRange portRange);
319 bool tcpNoDelayOption()
const;
324 Session & tcpNoDelayOption(
bool improveLatency =
true);
331 bool sendLogoutOnException()
const;
337 Session & sendLogoutOnException(
bool sendLogoutOnException);
343 bool validateUnknownMessages()
const;
348 Session & validateUnknownMessages(
bool);
354 bool validateUnknownFields()
const;
359 Session & validateUnknownFields(
bool);
365 bool validateRequiredFields()
const;
370 Session & validateRequiredFields(
bool);
376 bool validateFieldValues()
const;
381 Session & validateFieldValues(
bool);
387 bool validateEmptyFieldValues()
const;
392 Session & validateEmptyFieldValues(
bool);
398 bool validateRepeatingGroupEntryCount()
const;
403 Session & validateRepeatingGroupEntryCount(
bool);
409 bool validateRepeatingGroupLeadingTag()
const;
414 Session & validateRepeatingGroupLeadingTag(
bool);
420 bool validateDuplicatedField()
const;
425 Session & validateDuplicatedField(
bool);
431 bool validateChecksum()
const;
436 Session & validateChecksum(
bool);
442 unsigned messageGrouping()
const;
447 Session & messageGrouping(
unsigned numberOfMessagesToGroup);
462 bool useSpinLock()
const;
467 Session & useSpinLock(
bool value);
473 int reasonableTransmissionTime()
const;
484 Session & reasonableTransmissionTime(
int value);
489 Session & reconnectAttempts(
int value);
495 int reconnectAttempts()
const;
500 Session & reconnectInterval(
int value);
506 int reconnectInterval()
const;
513 Session & receiveSpinningTimeoutUsec(
int usec);
519 int receiveSpinningTimeout()
const;
527 Session & sendSpinningTimeoutUsec(
int usec);
533 int sendSpinningTimeout()
const;
538 Session & supportNextExpectedMsgSeqNum(
bool support);
544 bool supportNextExpectedMsgSeqNum()
const;
551 std::string sslCertificateFile()
const;
560 Session & sslCertificateFile(
const std::string & file);
567 std::string sslPrivateKeyFile()
const;
576 Session & sslPrivateKeyFile(
const std::string & file);
597 Session & sslVerifyPeer(
bool verify);
605 bool sslVerifyPeer()
const;
614 Session & sslClientSni(
const std::string & hostName);
619 const std::string & sslClientSni()
const;
626 Session & sslCaFile(
const std::string & value);
633 std::string sslCaFile()
const;
684 Session & logonAsInitiator(
const std::string & host,
int port,
bool setResetSeqNumFlag);
696 Session & logonAsInitiator(
const std::string & host,
int port);
705 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec);
714 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
bool setResetSeqNumFlag);
723 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg);
732 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg,
bool setResetSeqNumFlag);
768 Session & logout(
const std::string & text);
867 template<
typename MsgType>
883 typedef typename Traits::MsgBatchType::iterator
iterator;
889 void add(MessagePtr & msg) { MsgBatchHelper::add(batch_, coreBatch_, msg); }
891 MsgType &
operator[](
size_t index) {
return *batch_[index]; }
892 const MsgType &
operator[](
size_t index)
const {
return *batch_[index]; }
894 size_t size()
const {
return batch_.size(); }
896 const_iterator
begin()
const {
return batch_.begin(); }
897 iterator
begin() {
return batch_.begin(); }
899 const_iterator
end()
const {
return batch_.end(); }
900 iterator
end() {
return batch_.end(); }
925 Session & send(MessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
926 Session & send(FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
980 Session & sendAsIs(FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
998 size_t tryThrottle(
bool resetWhenDelay =
false);
1008 Session & throttlingLimit(
size_t messagesCount,
size_t intervalInMs = 1000);
1029 static bool checkWarmupFlags(
int warmupFlags,
unsigned short baseListenPort = 5000,
const std::string & localNetworkInterface =
"127.0.0.1");
1036 void preFill(
Message & msg)
const;
1048 void preFill(FlatMessageBatch & msgs)
const;
1062 operator const std::string & ()
const;
1069 const std::string & storageId()
const;
1079 Session & flushSessionStorage(
bool syncData =
false);
1089 std::string counterpartyHost()
const;
1096 std::string counterpartyIpAddress()
const;
1103 size_t counterpartyPort()
const;
1110 const std::string & customKey()
const;
1117 size_t outboundQueueBytes()
const;
1122 int heartbeatIntervalSec()
const;
1128 bool logInboundMessages()
const;
1133 Session & logInboundMessages(
bool value);
1139 bool logOutboundMessages()
const;
1144 Session & logOutboundMessages(
bool value);
1156 InboundMessageLogFilter inboundMessageLogFilter()
const;
1163 Session & inboundMessageLogFilter(
const InboundMessageLogFilter & filter);
1175 OutboundMessageLogFilter outboundMessageLogFilter()
const;
1182 Session & outboundMessageLogFilter(
const OutboundMessageLogFilter & filter);
1190 bool logBeforeSending()
const;
1197 Session & logBeforeSending(
bool value);
1242 Session & resendRequestMaximumRange(
int range);
1252 int resendRequestMaximumRange()
const;
1274 Session & resendingBatchSize(
size_t value);
1281 size_t resendingBatchSize()
const;
1295 const std::string & senderCompId()
const;
1301 bool specifyLastMsgSeqNumProcessed()
const;
1309 Session & specifyLastMsgSeqNumProcessed(
bool specify);
1315 bool updateSendingTimeField()
const;
1320 Session & updateSendingTimeField(
bool specify);
1333 const std::string & targetCompId()
const;
1378 int receivingThreadPriority()
const;
1383 Session & receivingThreadPriority(
int priority);
1388 int sendingThreadPriority()
const;
1393 Session & sendingThreadPriority(
int priority);
1398 int receivingThreadPolicy()
const;
1403 Session & receivingThreadPolicy(
int policy);
1408 int sendingThreadPolicy()
const;
1413 Session & sendingThreadPolicy(
int policy);
1444 Session & reportNewMessagesWhileWaitingForMissedMessages(
bool report);
1449 bool reportNewMessagesWhileWaitingForMissedMessages()
const;
1455 Session & sendResendRequestOnEachMessageGap(
bool send);
1460 bool sendResendRequestOnEachMessageGap()
const;
1468 Session & requestOnlyMissedMessages(
bool request);
1473 bool requestOnlyMissedMessages()
const;
1479 Session & considerRejectOnResendRequestAsGapFill(
bool consider);
1484 bool considerRejectOnResendRequestAsGapFill()
const;
1491 Session & ignoreLessThanExpectedSequenceNumber(
bool ignore);
1496 bool ignoreLessThanExpectedSequenceNumber()
const;
1501 Session & resetLocalSequenceNumbersOnLogon(
bool reset);
1506 bool resetLocalSequenceNumbersOnLogon()
const;
1514 Session & incomingMessageGapQueueMaximumSize(
size_t maxSize);
1520 size_t incomingMessageGapQueueMaximumSize()
const;
1537 Session & unregisterAllListeners();
1546 Session & resetLocalSequenceNumbers();
1553 Session & resetSeqNumViaLogonExchange();
1560 std::string senderSubId()
const;
1567 Session & senderSubId(
const std::string & value);
1574 std::string targetSubId()
const;
1581 Session & targetSubId(
const std::string & value);
1588 std::string senderLocationId()
const;
1595 Session & senderLocationId(
const std::string & value);
1602 std::string targetLocationId()
const;
1609 Session & targetLocationId(
const std::string & value);
1614 Session & validateSequenceNumbers(
bool value);
1620 bool validateSequenceNumbers()
const;
1627 std::string threadNameSuffix()
const;
1639 Session & threadNameSuffix(
const std::string & value);
1687 std::string toString()
const;
1716 Session & logDirectory(
const std::string & value);
1723 const std::string & logDirectory()
const;
1754 Session & scrambleLogonFields(
const ScrambledFields & fields);
1759 ScrambledFields scrambleLogonFields()
const;
1767 Session & sendQueueMaxSize(
size_t size);
1773 size_t sendQueueMaxSize()
const;
1795 int receiveBufferSize()
const;
1803 Session & receiveBufferSize(
int value);
1811 int sendBufferSize()
const;
1819 Session & sendBufferSize(
int value);
1827 bool enableRxTimestamp()
const;
1835 Session & enableRxTimestamp(
bool value);
1843 void scheduleShrinkToFit();
1851 :host(), port(), username(), password()
1854 ProxySettings(
const std::string & proxyHost,
int proxyPort,
const std::string & proxyUsername = std::string(),
const std::string & proxyPassword = std::string())
1855 :host(proxyHost), port(proxyPort), username(proxyUsername), password(proxyPassword)
1888 const std::string & senderCompId,
1889 const std::string & targetCompId,
1892 bool keepSequenceNumbersAfterLogout,
1895 const std::string & customSessionKey,
1900 friend class Engine::Impl;
The FIX Session - a bi-directional stream of ordered messages between two parties within a continuous...
The file based storage. The session's state and messages are persisted to the file system...
ONIXS_FIXENGINE_API std::ostream & operator<<(std::ostream &os, const Group &group)
Stream output.
Traits::MsgBatchType::iterator iterator
MsgType & operator[](size_t index)
std::set< std::string > InboundMessageLogFilter
Incoming message types to be filtered out from the logs.
static const OnixS::Sockets::Handle InvalidSocketHandle
Represents an invalid value of the socket handle.
const_iterator begin() const
size_t CpuIndex
Logical processors that a thread is allowed to run on (first logical CPU has index 0)...
static TimeSpan zero()
The zero value of the time span.
int Handle
Type alias for socket handle.
std::set< std::string > OutboundMessageLogFilter
Outgoing message types to be filtered out from the logs.
#define ONIXS_FIXENGINE_NULLPTR
The session's Listener.
FlatMessageBatch SerializedMessageBatch
std::vector< Tag > ScrambledFields
The collection of scrambled tags.
std::vector< OnixS::FIX::Core::Messaging::Message * > CoreMsgBatchType
const MsgType & operator[](size_t index) const
#define ONIXS_FIXENGINE_API
const_iterator end() const
PtrTraits< Message >::UniquePtr MessagePtr
Provides an access to FIX fields from a flat (tag=value) message.
virtual size_t resendingQueueSize() const =0
Returns the number of sent messages that are available for resending on counterparty's Resend Request...
ProxySettings(const std::string &proxyHost, int proxyPort, const std::string &proxyUsername=std::string(), const std::string &proxyPassword=std::string())
std::set< CpuIndex > CpuIndexes
MsgBatch< FlatMessage > FlatMessageBatch
Identifies the FIX messages dictionary.
std::vector< Message * > MsgBatchType
static const int UndefinedPriorityAndPolicy
Represents an undefined value of priority and policy.
Traits::MsgBatchType::const_iterator const_iterator
The session message mode.
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)
virtual void clear()=0
Clears the storage.
The immutable secure string.
std::pair< unsigned short, unsigned short > LocalPortRange
The local port range type.
PtrTraits< MsgType >::UniquePtr MessagePtr
The time span related functionality.
std::vector< FlatMessage * > MsgBatchType
MsgBatch< Message > MessageBatch
The session's pluggable storage.
The session's network stack reactor interface.
unsigned int SequenceNumber
Alias for the sequence number.
std::vector< OnixS::FIX::Core::Messaging::Extras::FlatMessage * > CoreMsgBatchType
Represents a future result of an asynchronous operation - a result that will eventually appear in the...
Encapsulates operations over a FIX Message.
virtual SequenceNumber outSeqNum()=0
Returns the last outgoing sequence number.
std::vector< SocketOption > SocketOptions
Storage type of socket options.
std::auto_ptr< T > UniquePtr
Traits::MessagePtr MessagePtr
void add(MessagePtr &msg)
The timestamps related functionality.
static const unsigned int ResendRequestMaximumRangeNoLimit
Represents an unlimited number of messages to be requested in one Resend Request (MsgType=2) message...
virtual SequenceNumber inSeqNum()=0
Returns the last inbound sequence number.