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;
612 Session & sslCaFile(
const std::string & value);
619 std::string sslCaFile()
const;
642 Session & logonAsInitiator(
const std::string & host,
int port,
bool setResetSeqNumFlag);
654 Session & logonAsInitiator(
const std::string & host,
int port);
663 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec);
672 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
bool setResetSeqNumFlag);
681 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg);
690 Session & logonAsInitiator(
const std::string & host,
int port,
int heartbeatIntervalSec,
Message * customLogonMsg,
bool setResetSeqNumFlag);
726 Session & logout(
const std::string & text);
825 template<
typename MsgType>
841 typedef typename Traits::MsgBatchType::iterator
iterator;
847 void add(MessagePtr & msg) { MsgBatchHelper::add(batch_, coreBatch_, msg); }
849 MsgType &
operator[](
size_t index) {
return *batch_[index]; }
850 const MsgType &
operator[](
size_t index)
const {
return *batch_[index]; }
852 size_t size()
const {
return batch_.size(); }
854 const_iterator
begin()
const {
return batch_.begin(); }
855 iterator
begin() {
return batch_.begin(); }
857 const_iterator
end()
const {
return batch_.end(); }
858 iterator
end() {
return batch_.end(); }
883 Session & send(MessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
884 Session & send(FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
932 Session & sendAsIs(FlatMessageBatch & msgs,
size_t maxPacketSize = (std::numeric_limits<size_t>::max)());
950 Session & throttlingLimit(
size_t messagesCount,
size_t intervalInMs = 1000);
971 static bool checkWarmupFlags(
int warmupFlags,
unsigned short baseListenPort = 5000,
const std::string & localNetworkInterface =
"127.0.0.1");
978 void preFill(
Message & msg)
const;
990 void preFill(FlatMessageBatch & msgs)
const;
1004 operator const std::string & ()
const;
1011 const std::string & storageId()
const;
1018 Session & flushSessionStorage();
1028 std::string counterpartyHost()
const;
1035 std::string counterpartyIpAddress()
const;
1042 size_t counterpartyPort()
const;
1049 const std::string & customKey()
const;
1056 size_t outboundQueueBytes()
const;
1061 int heartbeatIntervalSec()
const;
1067 bool logInboundMessages()
const;
1072 Session & logInboundMessages(
bool value);
1078 bool logOutboundMessages()
const;
1083 Session & logOutboundMessages(
bool value);
1095 InboundMessageLogFilter inboundMessageLogFilter()
const;
1102 Session & inboundMessageLogFilter(
const InboundMessageLogFilter & filter);
1114 OutboundMessageLogFilter outboundMessageLogFilter()
const;
1121 Session & outboundMessageLogFilter(
const OutboundMessageLogFilter & filter);
1129 bool logBeforeSending()
const;
1136 Session & logBeforeSending(
bool value);
1181 Session & resendRequestMaximumRange(
int range);
1191 int resendRequestMaximumRange()
const;
1220 const std::string & senderCompId()
const;
1226 bool specifyLastMsgSeqNumProcessed()
const;
1234 Session & specifyLastMsgSeqNumProcessed(
bool specify);
1240 bool updateSendingTimeField()
const;
1245 Session & updateSendingTimeField(
bool specify);
1258 const std::string & targetCompId()
const;
1303 int receivingThreadPriority()
const;
1308 Session & receivingThreadPriority(
int priority);
1313 int sendingThreadPriority()
const;
1318 Session & sendingThreadPriority(
int priority);
1323 int receivingThreadPolicy()
const;
1328 Session & receivingThreadPolicy(
int policy);
1333 int sendingThreadPolicy()
const;
1338 Session & sendingThreadPolicy(
int policy);
1369 Session & reportNewMessagesWhileWaitingForMissedMessages(
bool report);
1374 bool reportNewMessagesWhileWaitingForMissedMessages()
const;
1380 Session & sendResendRequestOnEachMessageGap(
bool send);
1385 bool sendResendRequestOnEachMessageGap()
const;
1393 Session & requestOnlyMissedMessages(
bool request);
1398 bool requestOnlyMissedMessages()
const;
1404 Session & considerRejectOnResendRequestAsGapFill(
bool consider);
1409 bool considerRejectOnResendRequestAsGapFill()
const;
1416 Session & ignoreLessThanExpectedSequenceNumber(
bool ignore);
1421 bool ignoreLessThanExpectedSequenceNumber()
const;
1426 Session & resetLocalSequenceNumbersOnLogon(
bool reset);
1431 bool resetLocalSequenceNumbersOnLogon()
const;
1439 Session & incomingMessageGapQueueMaximumSize(
size_t maxSize);
1445 size_t incomingMessageGapQueueMaximumSize()
const;
1462 Session & unregisterAllListeners();
1471 Session & resetLocalSequenceNumbers();
1478 Session & resetSeqNumViaLogonExchange();
1485 std::string senderSubId()
const;
1492 Session & senderSubId(
const std::string & value);
1499 std::string targetSubId()
const;
1506 Session & targetSubId(
const std::string & value);
1513 std::string senderLocationId()
const;
1520 Session & senderLocationId(
const std::string & value);
1527 std::string targetLocationId()
const;
1534 Session & targetLocationId(
const std::string & value);
1539 Session & validateSequenceNumbers(
bool value);
1545 bool validateSequenceNumbers()
const;
1552 std::string threadNameSuffix()
const;
1564 Session & threadNameSuffix(
const std::string & value);
1612 std::string toString()
const;
1641 Session & logDirectory(
const std::string & value);
1648 const std::string & logDirectory()
const;
1679 Session & scrambleLogonFields(
const ScrambledFields & fields);
1684 ScrambledFields scrambleLogonFields()
const;
1692 Session & sendQueueMaxSize(
size_t size);
1698 size_t sendQueueMaxSize()
const;
1720 int receiveBufferSize()
const;
1728 Session & receiveBufferSize(
int value);
1736 int sendBufferSize()
const;
1744 Session & sendBufferSize(
int value);
1752 void scheduleShrinkToFit();
1760 :host(), port(), username(), password()
1763 ProxySettings(
const std::string & proxyHost,
int proxyPort,
const std::string & proxyUsername = std::string(),
const std::string & proxyPassword = std::string())
1764 :host(proxyHost), port(proxyPort), username(proxyUsername), password(proxyPassword)
1797 const std::string & senderCompId,
1798 const std::string & targetCompId,
1801 bool keepSequenceNumbersAfterLogout,
1804 const std::string & customSessionKey,
1809 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.