78template<
typename MsgType>
83 typedef std::vector<OnixS::FIX::Core::Messaging::Extras::FlatMessage*>
CoreMsgBatchType;
153 bool keepSequenceNumbersAfterLogout,
176 bool keepSequenceNumbersAfterLogout,
197 bool keepSequenceNumbersAfterLogout,
199 const std::string & customSessionKey,
221 bool keepSequenceNumbersAfterLogout,
223 const std::string & customSessionKey,
924 template<
typename MsgType>
class MsgBatch;
941 template<
typename MsgType>
951 MsgBatch(
const MsgBatch&);
952 MsgBatch & operator=(
const MsgBatch&);
957 typedef typename Traits::MsgBatchType::iterator
iterator;
963 void add(
MessagePtr & msg) { MsgBatchHelper::add(batch_, coreBatch_, msg); }
965 MsgType &
operator[](
size_t index) {
return *batch_[index]; }
966 const MsgType &
operator[](
size_t index)
const {
return *batch_[index]; }
968 size_t size()
const {
return batch_.size(); }
1184 operator const std::string & ()
const;
2016 ProxySettings(
const std::string & proxyHost,
int proxyPort,
const std::string & proxyUsername = std::string(),
const std::string & proxyPassword = std::string())
2054 bool keepSequenceNumbersAfterLogout,
2057 const std::string & customSessionKey,
2062 friend class Engine::Impl;
#define ONIXS_FIXENGINE_API
The immutable secure string.
Identifies the FIX messages dictionary.
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
const MsgType & operator[](size_t index) const
Traits::MsgBatchType::const_iterator const_iterator
MsgType & operator[](size_t index)
void add(MessagePtr &msg)
const_iterator end() const
Traits::MessagePtr MessagePtr
Traits::MsgBatchType::iterator iterator
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(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)
TimeSpan resendTimeout() const
Session & targetSubId(const std::string &value)
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
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(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
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
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
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
std::string sslCaFile() const
Session & logInboundMessages(bool value)
static const OnixS::Sockets::Handle InvalidSocketHandle
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
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
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
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
std::set< std::string > InboundMessageLogFilter
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)
Session & resetLocalSequenceNumbers()
bool validateRepeatingGroupLeadingTag() const
Session & sendingThreadPriority(int priority)
void scheduleShrinkToFit()
Session & send(Message *msg)
bool validateUnknownFields() const
The time span related functionality.
static TimeSpan zero()
The zero value of the time span.
The timestamps related functionality.
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.
int Handle
Type alias for socket handle.
size_t CpuIndex
Logical processors that a thread is allowed to run on (first logical CPU has index 0).
std::set< CpuIndex > CpuIndexes
The session message mode.
@ FlatMessage
The FlatMessage class is used in inbound callbacks.
@ Message
The default mode. The Message class is used in inbound callbacks.
std::vector< Message * > MsgBatchType
PtrTraits< Message >::UniquePtr MessagePtr
std::vector< OnixS::FIX::Core::Messaging::Message * > CoreMsgBatchType
std::vector< FlatMessage * > MsgBatchType
std::vector< OnixS::FIX::Core::Messaging::Extras::FlatMessage * > CoreMsgBatchType
PtrTraits< MsgType >::UniquePtr MessagePtr
@ 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())
std::unique_ptr< T > UniquePtr