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;
1076 Session & flushSessionStorage();
1086 std::string counterpartyHost()
const;
1093 std::string counterpartyIpAddress()
const;
1100 size_t counterpartyPort()
const;
1107 const std::string & customKey()
const;
1114 size_t outboundQueueBytes()
const;
1119 int heartbeatIntervalSec()
const;
1125 bool logInboundMessages()
const;
1130 Session & logInboundMessages(
bool value);
1136 bool logOutboundMessages()
const;
1141 Session & logOutboundMessages(
bool value);
1153 InboundMessageLogFilter inboundMessageLogFilter()
const;
1160 Session & inboundMessageLogFilter(
const InboundMessageLogFilter & filter);
1172 OutboundMessageLogFilter outboundMessageLogFilter()
const;
1179 Session & outboundMessageLogFilter(
const OutboundMessageLogFilter & filter);
1187 bool logBeforeSending()
const;
1194 Session & logBeforeSending(
bool value);
1239 Session & resendRequestMaximumRange(
int range);
1249 int resendRequestMaximumRange()
const;
1278 const std::string & senderCompId()
const;
1284 bool specifyLastMsgSeqNumProcessed()
const;
1292 Session & specifyLastMsgSeqNumProcessed(
bool specify);
1298 bool updateSendingTimeField()
const;
1303 Session & updateSendingTimeField(
bool specify);
1316 const std::string & targetCompId()
const;
1361 int receivingThreadPriority()
const;
1366 Session & receivingThreadPriority(
int priority);
1371 int sendingThreadPriority()
const;
1376 Session & sendingThreadPriority(
int priority);
1381 int receivingThreadPolicy()
const;
1386 Session & receivingThreadPolicy(
int policy);
1391 int sendingThreadPolicy()
const;
1396 Session & sendingThreadPolicy(
int policy);
1427 Session & reportNewMessagesWhileWaitingForMissedMessages(
bool report);
1432 bool reportNewMessagesWhileWaitingForMissedMessages()
const;
1438 Session & sendResendRequestOnEachMessageGap(
bool send);
1443 bool sendResendRequestOnEachMessageGap()
const;
1451 Session & requestOnlyMissedMessages(
bool request);
1456 bool requestOnlyMissedMessages()
const;
1462 Session & considerRejectOnResendRequestAsGapFill(
bool consider);
1467 bool considerRejectOnResendRequestAsGapFill()
const;
1474 Session & ignoreLessThanExpectedSequenceNumber(
bool ignore);
1479 bool ignoreLessThanExpectedSequenceNumber()
const;
1484 Session & resetLocalSequenceNumbersOnLogon(
bool reset);
1489 bool resetLocalSequenceNumbersOnLogon()
const;
1497 Session & incomingMessageGapQueueMaximumSize(
size_t maxSize);
1503 size_t incomingMessageGapQueueMaximumSize()
const;
1520 Session & unregisterAllListeners();
1529 Session & resetLocalSequenceNumbers();
1536 Session & resetSeqNumViaLogonExchange();
1543 std::string senderSubId()
const;
1550 Session & senderSubId(
const std::string & value);
1557 std::string targetSubId()
const;
1564 Session & targetSubId(
const std::string & value);
1571 std::string senderLocationId()
const;
1578 Session & senderLocationId(
const std::string & value);
1585 std::string targetLocationId()
const;
1592 Session & targetLocationId(
const std::string & value);
1597 Session & validateSequenceNumbers(
bool value);
1603 bool validateSequenceNumbers()
const;
1610 std::string threadNameSuffix()
const;
1622 Session & threadNameSuffix(
const std::string & value);
1670 std::string toString()
const;
1699 Session & logDirectory(
const std::string & value);
1706 const std::string & logDirectory()
const;
1737 Session & scrambleLogonFields(
const ScrambledFields & fields);
1742 ScrambledFields scrambleLogonFields()
const;
1750 Session & sendQueueMaxSize(
size_t size);
1756 size_t sendQueueMaxSize()
const;
1778 int receiveBufferSize()
const;
1786 Session & receiveBufferSize(
int value);
1794 int sendBufferSize()
const;
1802 Session & sendBufferSize(
int value);
1810 void scheduleShrinkToFit();
1818 :host(), port(), username(), password()
1821 ProxySettings(
const std::string & proxyHost,
int proxyPort,
const std::string & proxyUsername = std::string(),
const std::string & proxyPassword = std::string())
1822 :host(proxyHost), port(proxyPort), username(proxyUsername), password(proxyPassword)
1855 const std::string & senderCompId,
1856 const std::string & targetCompId,
1859 bool keepSequenceNumbersAfterLogout,
1862 const std::string & customSessionKey,
1867 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.
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.