OnixS C++ ICE Binary Order Entry Handler 1.1.2
API Documentation
Loading...
Searching...
No Matches
BgwSession Class Reference

Public Member Functions

 BgwSession (const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, const std::string &customKey={}, const Utils::BuildInfo &=Utils::consumerBuildInfo())
 BgwSession (SessionReactor &stack, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, const std::string &customKey={}, const Utils::BuildInfo &=Utils::consumerBuildInfo())
 BgwSession (ServiceFactory &service, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, const std::string &customKey={}, const Utils::BuildInfo &=Utils::consumerBuildInfo())
Session & connect (const std::string &host, Port port, const std::string &ipSessionToken)
Threading::SharedFuture< void > connectAsync (const std::string &host, Port port, const std::string &ipSessionToken)
Session & connect (const BgwCredentials &bgwCredentials)
Threading::SharedFuture< void > connectAsync (const BgwCredentials &bgwCredentials)
Public Member Functions inherited from Session
 Session (SessionType::Enum sessionType, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, const std::string &customKey={}, const Utils::BuildInfo &=Utils::consumerBuildInfo())
 Session (SessionReactor &stack, SessionType::Enum sessionType, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, const std::string &customKey={}, const Utils::BuildInfo &=Utils::consumerBuildInfo())
 Session (ServiceFactory &service, SessionType::Enum sessionType, const SessionSettings &settings, SessionListener *listener, SessionStorageType::Enum storageType=SessionStorageType::FileBased, SessionStorage *storage=nullptr, const std::string &customKey={}, const Utils::BuildInfo &=Utils::consumerBuildInfo())
 ~Session ()
std::string id () const
int clientId () const noexcept
std::string userId () const noexcept
std::string customKey () const
Session & connect (const std::string &host, Port port, const std::string &ipSessionToken={})
Threading::SharedFuture< void > connectAsync (const std::string &host, Port port, const std::string &ipSessionToken={})
Session & disconnect (const std::string &reason={})
Threading::SharedFuture< void > disconnectAsync (const std::string &reason={})
Session & breakConnection ()
Threading::SharedFuture< void > breakConnectionAsync ()
template<typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
Session & send (Messaging::MessageHolder< SbeMessageType, MaxMessageSize, MessageInitializer > &msg, Messaging::Timestamp sendingTime=UtcWatch::now())
template<typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
Session & send (Messaging::MessageHolder< SbeMessageType, MaxMessageSize, MessageInitializer > &&msg, Messaging::Timestamp sendingTime=UtcWatch::now())
template<typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
Session & send (MessageBatch< SbeMessageType, MaxMessageSize, MessageInitializer > &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize)
Session & send (MessageBatchCombiner &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize)
Session & send (NetworkMessage *begin, NetworkMessage *end, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize) ONIXS_ICEBOE_NONULL
Session & send (NetMessagesRange range, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize)
Session & sendSequenceMessage ()
template<typename SbeMessageType, size_t MaxMessageSize>
Session & warmUp (Messaging::MessageHolder< SbeMessageType, MaxMessageSize > &msg, Messaging::Timestamp sendingTime=UtcWatch::now(), int warmupFlags=0)
template<typename SbeMessageType, size_t MaxMessageSize, typename MessageInitializer>
Session & warmUp (MessageBatch< SbeMessageType, MaxMessageSize, MessageInitializer > &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize, int warmupFlags=0)
Session & warmUp (MessageBatchCombiner &msgs, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize, int warmupFlags=0)
Session & warmUp (NetworkMessage *begin, NetworkMessage *end, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize, int warmupFlags=0) ONIXS_ICEBOE_NONULL
Session & warmUp (NetMessagesRange range, Messaging::Timestamp sendingTime=UtcWatch::now(), size_t maxPacketSize=MaxPacketSize, int warmupFlags=0)
Session & throttle ()
size_t tryThrottle ()
Session & throttlingLimit (size_t messagesCount, size_t intervalInMs=1000)
std::string remoteHost () const
std::string remoteIpAddress () const
Port remotePort () const
std::pair< Port, Port > localPortRange () const noexcept
Session & localPortRange (std::pair< Port, Port > portRange)
std::string localNetworkInterface () const
Session & localNetworkInterface (const std::string &value)
Port localPort () const
bool tcpNoDelayOption () const
Session & tcpNoDelayOption (bool value)
const SocketOptions & socketOptions () const
Session & socketOptions (const SocketOptions &options)
Session & receivingThreadAffinity (CpuIndex cpuIndex)
Session & receivingThreadAffinity (const CpuIndexes &cpuIndexes)
const CpuIndexes & receivingThreadAffinity () const
Session & sendingThreadAffinity (CpuIndex cpuIndex)
Session & sendingThreadAffinity (const CpuIndexes &cpuIndexes)
const CpuIndexes & sendingThreadAffinity () const
int receivingThreadPriority () const
Session & receivingThreadPriority (int priority)
int sendingThreadPriority () const
Session & sendingThreadPriority (int priority)
int receivingThreadPolicy () const
Session & receivingThreadPolicy (int policy)
int sendingThreadPolicy () const
Session & sendingThreadPolicy (int policy)
unsigned receiveSpinningTimeout () const noexcept
Session & receiveSpinningTimeout (unsigned timeoutInUs)
unsigned sendSpinningTimeout () const noexcept
Session & sendSpinningTimeout (unsigned timeoutInUs)
bool reportNewMessagesWhileWaitingForMissedMessages () const
Session & reportNewMessagesWhileWaitingForMissedMessages (bool value)
unsigned messageGrouping () const noexcept
Session & messageGrouping (unsigned numberOfMessagesToGroup)
SessionStorageType::Enum storageType () const noexcept
const std::string & storageId () const noexcept
SeqNumber outSeqNum () const noexcept
Session & outSeqNum (SeqNumber nextOutSeqNum)
SeqNumber inSeqNum () const
Session & inSeqNum (SeqNumber nextExpectedInSeqNum)
Session & reset ()
SessionStateId::Enum state () const
Messaging::Timestamp creationTime () const noexcept
void flushSessionStorage ()
unsigned reconnectAttempts () const
Session & reconnectAttempts (unsigned reconnectAttempts)
unsigned reconnectInterval () const
Session & reconnectInterval (unsigned seconds)
bool localTimeUsage () const
Session & localTimeUsage (bool useLocalTime)
const std::string & storageDirectory () const
bool logBeforeSending () const
Session & logBeforeSending (bool value)
size_t incomingMessageGapQueueMaximumSize () const
Session & incomingMessageGapQueueMaximumSize (size_t value)
const Session & log (const std::string &message) const
std::string toString () const
Messaging::Timestamp licenseExpirationDate () const
Messaging::SchemaVersion messagingVersion () const noexcept
Handle socketHandle ()
size_t outboundQueueBytes ()
bool getTcpInfo (TcpInfo &)

Additional Inherited Members

Static Public Member Functions inherited from Session
static const char * version () noexcept
Static Public Attributes inherited from Session
static const size_t MaxPacketSize = 1420
static const int UndefinedAffinity = -1
static const Handle InvalidSocketHandle
Protected Member Functions inherited from Session
Threading::SharedFuture< BgwCredentials > getBgwCredentialsAsync (const std::string &userId, bool forceRequest)

Detailed Description

Definition at line 28 of file BgwSession.h.

Constructor & Destructor Documentation

◆ BgwSession() [1/3]

BgwSession ( const SessionSettings & settings,
SessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
SessionStorage * storage = nullptr,
const std::string & customKey = {},
const Utils::BuildInfo & = Utils::consumerBuildInfo() )
inline

Constructor.

Parameters
settingsSession settings.
listenerSession listener.
storageTypeSession storage type.
storageSession storage.
customKeyCustom key that could be used to distinguish sessions with the same UserID and ClientId values.

Definition at line 40 of file BgwSession.h.

42 {}, const Utils::BuildInfo & = Utils::consumerBuildInfo())
43 : Session(SessionType::BGW, settings, listener, storageType, storage, customKey)
44 {}

◆ BgwSession() [2/3]

BgwSession ( SessionReactor & stack,
const SessionSettings & settings,
SessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
SessionStorage * storage = nullptr,
const std::string & customKey = {},
const Utils::BuildInfo & = Utils::consumerBuildInfo() )
inline

Constructor.

Parameters
stackSession reactor stack.
settingsSession settings.
listenerSession listener.
storageTypeSession storage type.
storageSession storage.
customKeyCustom key that could be used to distinguish sessions with the same UserID and ClientId values.

Definition at line 56 of file BgwSession.h.

58 {}, const Utils::BuildInfo & = Utils::consumerBuildInfo())
59 : Session(stack, SessionType::BGW, settings, listener, storageType, storage, customKey)
60 {}

◆ BgwSession() [3/3]

BgwSession ( ServiceFactory & service,
const SessionSettings & settings,
SessionListener * listener,
SessionStorageType::Enum storageType = SessionStorageType::FileBased,
SessionStorage * storage = nullptr,
const std::string & customKey = {},
const Utils::BuildInfo & = Utils::consumerBuildInfo() )
inline

Constructor.

Parameters
serviceService factory.
settingsSession settings.
listenerSession listener.
storageTypeSession storage type.
storageSession storage.
customKeyCustom key that could be used to distinguish sessions with the same UserID and ClientId values.

Definition at line 72 of file BgwSession.h.

74 {}, const Utils::BuildInfo & = Utils::consumerBuildInfo())
75 : Session(service, SessionType::BGW, settings, listener, storageType, storage, customKey)
76 {}

Member Function Documentation

◆ connect() [1/2]

Session & connect ( const BgwCredentials & bgwCredentials)
inline

Establishes the connection.

Parameters
bgwCredentialsGateway host.
Returns
This session.

Definition at line 103 of file BgwSession.h.

104 {
105 return connect(bgwCredentials.host(), bgwCredentials.port(), bgwCredentials.ipSessionToken());
106 }

◆ connect() [2/2]

Session & connect ( const std::string & host,
Port port,
const std::string & ipSessionToken )

Establishes the connection.

Parameters
hostGateway host.
portGateway port.
ipSessionTokenthe access key that was assigned by the exchange.
Returns
This session.

◆ connectAsync() [1/2]

Threading::SharedFuture< void > connectAsync ( const BgwCredentials & bgwCredentials)
inline

Establishes the connection asynchronously.

Parameters
bgwCredentialsGateway host.

Definition at line 113 of file BgwSession.h.

114 {
115 return connectAsync(bgwCredentials.host(), bgwCredentials.port(), bgwCredentials.ipSessionToken());
116 }

◆ connectAsync() [2/2]

Threading::SharedFuture< void > connectAsync ( const std::string & host,
Port port,
const std::string & ipSessionToken )

Establishes the connection asynchronously.

Parameters
hostGateway host.
portGateway port.
ipSessionTokenthe access key that was assigned by the exchange.