42 namespace AdHoc {
struct SessionHelper; };
50 static const UInt64 UndefinedUuid = 0;
77 std::
string id() const;
83 std::
string customKey() const;
86 bool negotiated() const;
91 Session& negotiated(
bool negotiated);
94 Messaging::
FTI::Enum faultToleranceIndicator() const;
97 Session& faultToleranceIndicator(Messaging::
FTI::Enum value);
115 Threading::SharedFuture<
void> connectAsync(const
std::
string & host,
Port port);
126 Session& disconnect(const
std::
string &reason = "");
133 Threading::SharedFuture<
void> disconnectAsync(const
std::
string & reason = "");
144 Threading::SharedFuture<
void> breakConnectionAsync();
156 template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
158 Messaging::
MessageHolder<SbeMessageType, MaxMessageSize, MessageInitializer> &msg,
161 #if defined (ONIXS_ILINK3_CXX11) 172 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
180 static const size_t CmeMaxPacketSize = 1420;
182 #if defined (ONIXS_ILINK3_CXX11) 199 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
203 size_t maxPacketSize = CmeMaxPacketSize);
223 size_t maxPacketSize = CmeMaxPacketSize);
251 template <
typename SbeMessageType,
size_t MaxMessageSize>
255 int warmupFlags = 0);
258 #if defined (ONIXS_ILINK3_CXX11) 275 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
279 size_t maxPacketSize = CmeMaxPacketSize,
280 int warmupFlags = 0);
299 size_t maxPacketSize = CmeMaxPacketSize,
int warmupFlags = 0);
316 size_t tryThrottle();
326 Session & throttlingLimit(
size_t messagesCount,
size_t intervalInMs = 1000);
329 std::string remoteHost()
const;
332 std::string remoteIpAddress()
const;
335 Port remotePort()
const;
338 std::pair<Port, Port> localPortRange() const ONIXS_ILINK3_NOTHROW;
344 std::
string localNetworkInterface() const;
347 Session& localNetworkInterface(const
std::
string &value);
350 Port localPort() const;
353 bool tcpNoDelayOption() const;
356 Session& tcpNoDelayOption(
bool value);
364 static const
int UndefinedAffinity = -1;
373 const
CpuIndexes &receivingThreadAffinity() const;
382 const
CpuIndexes &sendingThreadAffinity() const;
385 int receivingThreadPriority() const;
388 Session& receivingThreadPriority(
int priority);
391 int sendingThreadPriority() const;
394 Session& sendingThreadPriority(
int priority);
397 int receivingThreadPolicy() const;
400 Session& receivingThreadPolicy(
int policy);
403 int sendingThreadPolicy() const;
406 Session& sendingThreadPolicy(
int policy);
409 unsigned receiveSpinningTimeout() const ONIXS_ILINK3_NOTHROW;
412 Session& receiveSpinningTimeout(
unsigned timeoutInUs);
415 unsigned sendSpinningTimeout() const ONIXS_ILINK3_NOTHROW;
418 Session& sendSpinningTimeout(
unsigned timeoutInUs);
423 bool reportNewMessagesWhileWaitingForMissedMessages() const;
428 Session& reportNewMessagesWhileWaitingForMissedMessages(
bool value);
431 unsigned messageGrouping() const ONIXS_ILINK3_NOTHROW;
443 Session& messageGrouping(
unsigned numberOfMessagesToGroup);
449 const
std::
string &storageId() const ONIXS_ILINK3_NOTHROW;
452 SeqNumber outSeqNum() const ONIXS_ILINK3_NOTHROW;
468 SeqNumber previousSeqNo() const ONIXS_ILINK3_NOTHROW;
479 Messaging::
UInt64 previousUuid() const ONIXS_ILINK3_NOTHROW;
493 Session& reset(
bool startOfWeek = false);
499 Messaging::
Timestamp creationTime() const ONIXS_ILINK3_NOTHROW;
502 void flushSessionStorage();
505 unsigned reconnectAttempts() const;
508 Session& reconnectAttempts(
unsigned reconnectAttempts);
511 unsigned reconnectInterval() const;
514 Session& reconnectInterval(
unsigned seconds);
517 bool localTimeUsage() const;
520 Session& localTimeUsage(
bool useLocalTime);
523 const
std::
string &storageDirectory() const;
526 bool logBeforeSending() const;
529 Session& logBeforeSending(
bool value);
532 size_t incomingMessageGapQueueMaximumSize() const;
535 Session& incomingMessageGapQueueMaximumSize(
size_t value);
538 const
Session& log(const
std::
string &message) const;
541 std::
string toString() const;
544 Messaging::
Timestamp licenseExpirationDate() const;
547 Messaging::
SchemaVersion messagingVersion() const ONIXS_ILINK3_NOTHROW;
550 bool detectMessageGapForPreviousUuid() const;
553 Session& detectMessageGapForPreviousUuid(
bool detectGap);
564 size_t outboundQueueBytes();
574 static const
std::
string& version() ONIXS_ILINK3_NOTHROW;
578 Session& operator=(const Session& );
585 template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
586 void validate(const Messaging::
MessageHolder<SbeMessageType, MaxMessageSize, MessageInitializer> &msg) const;
588 void validateVersion(Messaging::
SchemaVersion version) const;
595 friend struct AdHoc::SessionHelper;
635 static const int marketSegmentId_ = INT_MAX;
638 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
653 template <
typename SbeMessageType,
size_t MaxMessageSize>
665 #if defined (ONIXS_ILINK3_CXX11) 667 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
679 #if defined (ONIXS_ILINK3_CXX11) 681 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
686 size_t maxPacketSize)
690 send(msgs.netMsgs_, maxPacketSize, ts);
694 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
702 warmUp(msgs.netMsgs_, maxPacketSize, flags, ts);
708 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
712 validateVersion(holder->version());
#define ONIXS_ILINK3_NULLPTR
std::vector< NetworkMessage > NetMessages
Contains the SimpleOpenFramingHeader, the SBE message, and the data buffer.
Session's network stack reactor interface.
Session & send(Messaging::MessageHolder< SbeMessageType, MaxMessageSize, MessageInitializer > &msg, Messaging::Timestamp sendingTime=UtcWatch::now())
Sends the message.
Messaging::UInt32 SeqNumber
void validate(const Message &)
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
std::set< CpuIndex > CpuIndexes
An iLink 3 Session for CME Convenience Gateways (CGW).
A network iLink3 message.
int Handle
Type alias for socket handle.
File-based Session Storage.
#define ONIXS_ILINK3_EXPORTED
Session & warmUp(Messaging::MessageHolder< SbeMessageType, MaxMessageSize > &msg, Messaging::Timestamp sendingTime=UtcWatch::now(), int warmupFlags=0)
Warms up the sending path.
The class can be used to combine messages with different types to the batch for sending.
std::vector< SocketOption > SocketOptions
Socket options.
The message batch wrapper.
#define ONIXS_ILINK3_HOTPATH
The time point without the time-zone information.
#define ONIXS_ILINK3_NOTHROW
NetworkMessage toNetworkMessage() noexcept