42namespace AdHoc {
struct SessionHelper; }
77 std::
string id() const;
156 template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
161#if defined (ONIXS_ILINK3_CXX11)
172 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
182#if defined (ONIXS_ILINK3_CXX11)
199 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
291 template <
typename SbeMessageType,
size_t MaxMessageSize>
295 int warmupFlags = 0);
298#if defined (ONIXS_ILINK3_CXX11)
315 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
320 int warmupFlags = 0);
360 size_t maxPacketSize =
CmeMaxPacketSize,
int warmupFlags = 0) ONIXS_ILINK3_NONULL;
668 template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
669 void validate(const
Messaging::
MessageHolder<SbeMessageType, MaxMessageSize, MessageInitializer> &msg) const;
717 int marketSegmentId() const noexcept;
718 static const
int marketSegmentId_ = INT_MAX;
721template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
731 send(msg.toNetworkMessage(), ts);
736template <
typename SbeMessageType,
size_t MaxMessageSize>
747#if defined (ONIXS_ILINK3_CXX11)
749template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
761#if defined (ONIXS_ILINK3_CXX11)
763template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
768 size_t maxPacketSize)
779 send(begin, end, maxPacketSize, ts);
783template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
799 warmUp(begin, end, maxPacketSize, flags, ts);
805template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
809 validateVersion(holder->version());
#define ONIXS_ILINK3_UNLIKELY(cond)
#define ONIXS_ILINK3_HOTPATH
#define ONIXS_ILINK3_EXPORTED
CgwSession(SessionReactor &stack, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, UInt64 uuid=UndefinedUuid, const std::string &customKey="")
CgwSession(const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, UInt64 uuid=UndefinedUuid, const std::string &customKey="")
NetworkMessage toNetworkMessage() noexcept
A network iLink3 message.
The time point without the time-zone information.
Session's network stack reactor interface.
static const UInt64 UndefinedUuid
bool localTimeUsage() const
Messaging::Timestamp licenseExpirationDate() const
unsigned messageGrouping() const noexcept
std::string localNetworkInterface() const
std::string customKey() const
Threading::SharedFuture< void > breakConnectionAsync()
friend struct AdHoc::SessionHelper
static const int UndefinedAffinity
static const size_t CmeMaxPacketSize
CME states: Packet size maximum behavior based on MTU (Maximum Transmission Unit) - 1420 bytes,...
std::string remoteIpAddress() const
Session(SessionReactor &stack, const SessionSettings &settings, int marketSegmentId, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, UInt64 uuid=UndefinedUuid, const std::string &customKey="")
std::string toString() const
Session & send(NetworkMessage *begin, NetworkMessage *end, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=CmeMaxPacketSize) ONIXS_ILINK3_NONULL
Session & breakConnection()
std::string remoteHost() const
const SocketOptions & socketOptions() const
unsigned reconnectAttempts() const
bool reportNewMessagesWhileWaitingForMissedMessages() const
Session & throttlingLimit(size_t messagesCount, size_t intervalInMs=1000)
Messaging::FTI::Enum faultToleranceIndicator() const
SeqNumber outSeqNum() const noexcept
Messaging::SchemaVersion messagingVersion() const noexcept
std::pair< Port, Port > localPortRange() const noexcept
const std::string & storageDirectory() const
int receivingThreadPolicy() const
Session & send(NetMessagesRange range, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=CmeMaxPacketSize)
size_t incomingMessageGapQueueMaximumSize() const
bool getTcpInfo(TcpInfo &)
bool detectMessageGapForPreviousUuid() const
Session & sendSequenceMessage(Messaging::KeepAliveLapsed::Enum keepAliveLapsed=Messaging::KeepAliveLapsed::Lapsed)
unsigned receiveSpinningTimeout() const noexcept
Session & warmUp(Messaging::MessageHolder< SbeMessageType, MaxMessageSize > &msg, Messaging::Timestamp sendingTime=UtcWatch::now(), int warmupFlags=0)
Session & receivingThreadAffinity(CpuIndex cpuIndex)
Sets the receiving thread CPU affinity.
int marketSegmentId() const noexcept
Session & warmUp(NetworkMessage *begin, NetworkMessage *end, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=CmeMaxPacketSize, int warmupFlags=0) ONIXS_ILINK3_NONULL
ThreadingModel::Enum threadingModel() const
unsigned reconnectInterval() const
SessionStorageType::Enum storageType() const noexcept
Messaging::UInt64 previousUuid() const noexcept
int sendingThreadPriority() const
UInt64 uuid() const noexcept
size_t outboundQueueBytes()
Returns the total number of bytes in the outbound queue.
const std::string & storageId() const noexcept
Session & send(MessageBatchCombiner &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=CmeMaxPacketSize)
static std::string version()
static const Handle InvalidSocketHandle
Represents invalid value of socket handle.
bool logBeforeSending() const
Session & disconnect(const std::string &reason="")
Messaging::Timestamp creationTime() const noexcept
Session & reset(bool startOfWeek=false)
SessionStateId::Enum state() const
void flushSessionStorage()
Flushes all internal buffers of the session storage.
SeqNumber inSeqNum() const
Session & send(Messaging::MessageHolder< SbeMessageType, MaxMessageSize, MessageInitializer > &msg, Messaging::Timestamp sendingTime=UtcWatch::now())
int receivingThreadPriority() const
const Session & log(const std::string &message) const
Write the given user's message to the Handler's log file using the session formatted Id.
Session & sendingThreadAffinity(CpuIndex cpuIndex)
Sets the sending thread CPU affinity.
Session & connect(const std::string &host, Port port)
SeqNumber previousSeqNo() const noexcept
Session & warmUp(MessageBatchCombiner &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=CmeMaxPacketSize, int warmupFlags=0)
unsigned sendSpinningTimeout() const noexcept
Session(const SessionSettings &settings, int marketSegmentId, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, UInt64 uuid=UndefinedUuid, const std::string &customKey="")
int sendingThreadPolicy() const
Sets the sending thread policy.
Threading::SharedFuture< void > disconnectAsync(const std::string &reason="")
bool tcpNoDelayOption() const
Threading::SharedFuture< void > connectAsync(const std::string &host, Port port)
void validate(const Message &)
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
std::pair< NetworkMessage *, NetworkMessage * > NetMessagesRange
std::vector< SocketOption > SocketOptions
Socket options.
int Handle
Type alias for socket handle.
std::set< CpuIndex > CpuIndexes
Messaging::UInt32 SeqNumber
@ FileBased
File-based Session Storage.