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);
463 int reasonableTransmissionTime()
const;
474 Session & reasonableTransmissionTime(
int value);
479 Session & reconnectAttempts(
int value);
485 int reconnectAttempts()
const;
490 Session & reconnectInterval(
int value);
496 int reconnectInterval()
const;
503 Session & receiveSpinningTimeoutUsec(
int usec);
509 int receiveSpinningTimeout()
const;
517 Session & sendSpinningTimeoutUsec(
int usec);
523 int sendSpinningTimeout()
const;
528 Session & supportNextExpectedMsgSeqNum(
bool support);
534 bool supportNextExpectedMsgSeqNum()
const;
541 std::string sslCertificateFile()
const;
550 Session & sslCertificateFile(
const std::string & file);
557 std::string sslPrivateKeyFile()
const;
566 Session & sslPrivateKeyFile(
const std::string & file);
587 Session & sslVerifyPeer(
bool verify);
595 bool sslVerifyPeer()
const;
602 Session & sslCaFile(
const std::string & value);
609 std::string sslCaFile()
const;
632 Session & logonAsInitiator(
const std::string & host,
int port,
bool setResetSeqNumFlag);
644 Session & logonAsInitiator(
const std::string & host,
int port);
653 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec);
662 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
bool setResetSeqNumFlag);
671 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg);
680 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg,
bool setResetSeqNumFlag);
716 Session & logout(
const std::string & text);
815 template<
typename MsgType>
831 typedef typename Traits::MsgBatchType::iterator
iterator;
837 void add(MessagePtr & msg) { MsgBatchHelper::add(batch_, coreBatch_, msg); }
839 MsgType &
operator[](
size_t index) {
return *batch_[index]; }
840 const MsgType &
operator[](
size_t index)
const {
return *batch_[index]; }
842 size_t size()
const {
return batch_.size(); }
844 const_iterator
begin()
const {
return batch_.begin(); }
845 iterator
begin() {
return batch_.begin(); }
847 const_iterator
end()
const {
return batch_.end(); }
848 iterator
end() {
return batch_.end(); }
873 Session & send(MessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
874 Session & send(FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
922 Session & sendAsIs(FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
940 Session & throttlingLimit(
size_t messagesCount,
size_t intervalInMs = 1000);
961 static bool checkWarmupFlags(
int warmupFlags,
unsigned short baseListenPort = 5000,
const std::string & localNetworkInterface =
"127.0.0.1");
968 void preFill(
Message & msg)
const;
980 void preFill(FlatMessageBatch & msgs)
const;
994 operator const std::string & ()
const;
1001 const std::string & storageId()
const;
1008 Session & flushSessionStorage();
1018 std::string counterpartyHost()
const;
1025 std::string counterpartyIpAddress()
const;
1032 size_t counterpartyPort()
const;
1039 const std::string & customKey()
const;
1046 size_t outboundQueueBytes()
const;
1051 int heartbeatIntervalSec()
const;
1057 bool logInboundMessages()
const;
1062 Session & logInboundMessages(
bool value);
1068 bool logOutboundMessages()
const;
1073 Session & logOutboundMessages(
bool value);
1085 InboundMessageLogFilter inboundMessageLogFilter()
const;
1092 Session & inboundMessageLogFilter(
const InboundMessageLogFilter & filter);
1104 OutboundMessageLogFilter outboundMessageLogFilter()
const;
1111 Session & outboundMessageLogFilter(
const OutboundMessageLogFilter & filter);
1119 bool logBeforeSending()
const;
1126 Session & logBeforeSending(
bool value);
1171 Session & resendRequestMaximumRange(
int range);
1181 int resendRequestMaximumRange()
const;
1188 Session & resendingQueueSize(
size_t value);
1196 size_t resendingQueueSize()
const;
1210 const std::string & senderCompId()
const;
1216 bool specifyLastMsgSeqNumProcessed()
const;
1224 Session & specifyLastMsgSeqNumProcessed(
bool specify);
1230 bool updateSendingTimeField()
const;
1235 Session & updateSendingTimeField(
bool specify);
1248 const std::string & targetCompId()
const;
1293 int receivingThreadPriority()
const;
1298 Session & receivingThreadPriority(
int priority);
1303 int sendingThreadPriority()
const;
1308 Session & sendingThreadPriority(
int priority);
1313 int receivingThreadPolicy()
const;
1318 Session & receivingThreadPolicy(
int policy);
1323 int sendingThreadPolicy()
const;
1328 Session & sendingThreadPolicy(
int policy);
1359 Session & reportNewMessagesWhileWaitingForMissedMessages(
bool report);
1364 bool reportNewMessagesWhileWaitingForMissedMessages()
const;
1370 Session & sendResendRequestOnEachMessageGap(
bool send);
1375 bool sendResendRequestOnEachMessageGap()
const;
1383 Session & requestOnlyMissedMessages(
bool request);
1388 bool requestOnlyMissedMessages()
const;
1394 Session & considerRejectOnResendRequestAsGapFill(
bool consider);
1399 bool considerRejectOnResendRequestAsGapFill()
const;
1406 Session & ignoreLessThanExpectedSequenceNumber(
bool ignore);
1411 bool ignoreLessThanExpectedSequenceNumber()
const;
1416 Session & resetLocalSequenceNumbersOnLogon(
bool reset);
1421 bool resetLocalSequenceNumbersOnLogon()
const;
1429 Session & incomingMessageGapQueueMaximumSize(
size_t maxSize);
1435 size_t incomingMessageGapQueueMaximumSize()
const;
1452 Session & unregisterAllListeners();
1461 Session & resetLocalSequenceNumbers();
1468 Session & resetSeqNumViaLogonExchange();
1475 std::string senderSubId()
const;
1482 Session & senderSubId(
const std::string & value);
1489 std::string targetSubId()
const;
1496 Session & targetSubId(
const std::string & value);
1503 std::string senderLocationId()
const;
1510 Session & senderLocationId(
const std::string & value);
1517 std::string targetLocationId()
const;
1524 Session & targetLocationId(
const std::string & value);
1529 Session & validateSequenceNumbers(
bool value);
1535 bool validateSequenceNumbers()
const;
1542 std::string threadNameSuffix()
const;
1554 Session & threadNameSuffix(
const std::string & value);
1602 std::string toString()
const;
1631 Session & logDirectory(
const std::string & value);
1638 const std::string & logDirectory()
const;
1669 Session & scrambleLogonFields(
const ScrambledFields & fields);
1674 ScrambledFields scrambleLogonFields()
const;
1680 void scheduleShrinkToFit();
1688 :host(), port(), username(), password()
1691 ProxySettings(
const std::string & proxyHost,
int proxyPort,
const std::string & proxyUsername = std::string(),
const std::string & proxyPassword = std::string())
1692 :host(proxyHost), port(proxyPort), username(proxyUsername), password(proxyPassword)
1725 const std::string & senderCompId,
1726 const std::string & targetCompId,
1729 bool keepSequenceNumbersAfterLogout,
1732 const std::string & customSessionKey,
1737 friend class Engine::Impl;
FIX Session - a bi-directional stream of ordered messages between two parties within a continuous seq...
File based storage. 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 invalid value of 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()
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.
FlatMessageBatch SerializedMessageBatch
std::vector< Tag > ScrambledFields
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 access to FIX fields from a flat (tag=value) message.
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 FIX messages dictionary.
std::vector< Message * > MsgBatchType
static const int UndefinedPriorityAndPolicy
Represents undefined value of priority and policy.
Traits::MsgBatchType::const_iterator const_iterator
ONIXS_FIXENGINE_API_DECL(class, IEngineListener)
std::pair< unsigned short, unsigned short > LocalPortRange
Local port range type.
PtrTraits< MsgType >::UniquePtr MessagePtr
Time span related functionality.
std::vector< FlatMessage * > MsgBatchType
MsgBatch< Message > MessageBatch
Session's pluggable storage.
Session's network stack reactor interface.
unsigned int SequenceNumber
Alias for 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.
std::vector< SocketOption > SocketOptions
Storage type of socket options.
std::auto_ptr< T > UniquePtr
Traits::MessagePtr MessagePtr
void add(MessagePtr &msg)
Timestamps related functionality.
static const unsigned int ResendRequestMaximumRangeNoLimit
Represents unlimited number of messages to be requested in one Resend Request (MsgType=2) message...