42namespace AdHoc {
struct SessionHelper; };
74 std::
string id() const;
132 template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
137#if defined (ONIXS_B3_BOE_CXX11)
148 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
158#if defined (ONIXS_B3_BOE_CXX11)
175 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
225 template <
typename SbeMessageType,
size_t MaxMessageSize>
229 int warmupFlags = 0);
232#if defined (ONIXS_B3_BOE_CXX11)
249 template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
254 int warmupFlags = 0);
528 template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
529 void validate(const
Messaging::
MessageHolder<SbeMessageType, MaxMessageSize, MessageInitializer> &msg) const;
541template <typename SbeMessageType,
size_t MaxMessageSize, typename MessageInitializer>
551 send(msg.toNetworkMessage(), ts);
556template <
typename SbeMessageType,
size_t MaxMessageSize>
568#if defined (ONIXS_B3_BOE_CXX11)
570template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
582#if defined (ONIXS_B3_BOE_CXX11)
584template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
589 size_t maxPacketSize)
593 send(msgs.netMsgs_, maxPacketSize, ts);
597template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
605 warmUp(msgs.netMsgs_, maxPacketSize, flags, ts);
611template <
typename SbeMessageType,
size_t MaxMessageSize,
typename MessageInitializer>
614 validateVersion(holder->version());
#define ONIXS_B3_BOE_NULLPTR
#define ONIXS_B3_BOE_EXPORTED
#define ONIXS_B3_BOE_NOTHROW
#define ONIXS_B3_BOE_HOTPATH
The class can be used to combine messages with different types to the batch for sending.
The message batch wrapper.
Contains the SimpleOpenFramingHeader, the SBE message, and the data buffer.
NetworkMessage toNetworkMessage() noexcept
The time point without the time-zone information.
Session's network stack reactor interface.
bool localTimeUsage() const
Messaging::Timestamp licenseExpirationDate() const
unsigned messageGrouping() const noexcept
std::string localNetworkInterface() const
std::string customKey() const
static const std::string & version() noexcept
friend struct AdHoc::SessionHelper
static const int UndefinedAffinity
std::string remoteIpAddress() const
Session & throttle()
Performs the throttling of a session that must be called before each send function call.
std::string toString() const
static const UInt64 UndefinedSessionVerID
std::string remoteHost() const
const SocketOptions & socketOptions() const
Session & warmUp(MessageBatchCombiner &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=B3BOEMaxPacketSize, int warmupFlags=0)
Warms up the sending path.
Session & disconnect()
Terminates the connection.
unsigned reconnectAttempts() const
bool reportNewMessagesWhileWaitingForMissedMessages() const
Session & throttlingLimit(size_t messagesCount, size_t intervalInMs=1000)
Sets throttling limit parameters.
SeqNumber outSeqNum() const noexcept
Threading::SharedFuture< void > disconnectAsync()
Terminates the connection asynchronously.
Messaging::SchemaVersion messagingVersion() const noexcept
std::pair< Port, Port > localPortRange() const noexcept
const std::string & storageDirectory() const
int receivingThreadPolicy() const
size_t incomingMessageGapQueueMaximumSize() const
bool getTcpInfo(TcpInfo &)
Gets information about the underlying TCP connection.
unsigned receiveSpinningTimeout() const noexcept
Messaging::SessionID sessionId() const noexcept
Session & warmUp(Messaging::MessageHolder< SbeMessageType, MaxMessageSize > &msg, Messaging::Timestamp sendingTime=UtcWatch::now(), int warmupFlags=0)
Warms up the sending path.
Handle socketHandle()
Returns the socket handle which the session uses to transmit data.
Session & receivingThreadAffinity(CpuIndex cpuIndex)
Sets the receiving thread CPU affinity.
unsigned reconnectInterval() const
SessionStorageType::Enum storageType() const noexcept
int sendingThreadPriority() const
static const size_t B3BOEMaxPacketSize
Packet size maximum behavior based on MTU (Maximum Transmission Unit) 1420 bytes.
size_t outboundQueueBytes()
Returns the total number of bytes in the outbound queue.
const std::string & storageId() const noexcept
size_t tryThrottle()
Checks the throttling of a session that must be called before each send function call.
static const Handle InvalidSocketHandle
Represents invalid value of socket handle.
bool logBeforeSending() const
Session & sendSequenceMessage()
Send the Sequence message.
Session(const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, UInt64 sessionVerId=UndefinedSessionVerID, const std::string &customKey="")
Constructor.
Session(SessionReactor &stack, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, UInt64 sessionVerId=UndefinedSessionVerID, const std::string &customKey="")
Messaging::Timestamp creationTime() const noexcept
UInt64 sessionVerId() const noexcept
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())
Sends the message.
Session & send(MessageBatchCombiner &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=B3BOEMaxPacketSize)
Sends messages.
Session & reset()
Backups the current log files, resets the sequence numbers to 1 and generates a new sessionVerId.
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)
Establishes the connection.
unsigned sendSpinningTimeout() const noexcept
int sendingThreadPolicy() const
Sets the sending thread policy.
bool tcpNoDelayOption() const
Threading::SharedFuture< void > connectAsync(const std::string &host, Port port)
Establishes the connection asynchronously.
A high-level wrapper over the TCPDirect network stack.
UInt32 SessionID
Client connection identification on the gateway assigned by B3.
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
std::vector< NetworkMessage > NetMessages
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.