OnixS C++ CME MDP Premium Market Data Handler 5.10.3
Users' manual and API documentation
Loading...
Searching...
No Matches
MulticastTarget Class Reference

#include <OnixS/CME/MDH/testing/MulticastSender.h>

Public Member Functions

 MulticastTarget (const RealtimeFeedSettings &feedSettings, Messaging::TimeSpan arbitrageDelay=Messaging::TimeSpan{}, ReplayDelayer &delayPolicy=CombinedReplayDelayer::service(), PacketSize packetMaxSize=DefaultMaxPacketSize)
 MulticastTarget (const MulticastRecoveryFeedSettings &feedSettings, Messaging::TimeSpan arbitrageDelay=Messaging::TimeSpan{}, ReplayDelayer &delayPolicy=CombinedReplayDelayer::service(), PacketSize packetMaxSize=DefaultMaxPacketSize)
 ~MulticastTarget ()
Threading::Event send (const void *data, size_t dataSize)
void sendA (const void *data, size_t dataSize)
void sendB (const void *data, size_t dataSize)
void sendPrimary (const void *data, size_t dataSize)
void sendSecondary (const void *data, size_t dataSize)
NetFeedRole::Enum primaryFeed () const noexcept
NetFeedRole::Enum secondaryFeed () const noexcept
bool hasSecondary () const noexcept
 MulticastTarget (const MulticastTarget &)=delete
MulticastTargetoperator= (const MulticastTarget &)=delete

Static Public Attributes

static constexpr PacketSize DefaultMaxPacketSize = 1420

Detailed Description

Definition at line 33 of file MulticastSender.h.

Constructor & Destructor Documentation

◆ MulticastTarget() [1/3]

MulticastTarget ( const RealtimeFeedSettings & feedSettings,
Messaging::TimeSpan arbitrageDelay = Messaging::TimeSpan{},
ReplayDelayer & delayPolicy = CombinedReplayDelayer::service(),
PacketSize packetMaxSize = DefaultMaxPacketSize )
explicit

Initializes the target from realtime multicast feed settings.

Parameters
feedSettingsRealtime feed settings that define the feed layout and the feed A/feed B multicast connection parameters.
arbitrageDelayDelay applied before sending to the secondary feed when both feeds are configured.
delayPolicyPolicy used to implement the secondary feed delay.
packetMaxSizeMaximum datagram payload size accepted by this target.
Exceptions
std::runtime_errorIf the realtime feed layout is unsupported, the primary feed endpoint is not populated, or an arbitrage layout does not provide both feed endpoints.

◆ MulticastTarget() [2/3]

Initializes the target from multicast recovery feed settings.

Parameters
feedSettingsRecovery feed settings that define the feed layout and the feed A/feed B multicast connection parameters.
arbitrageDelayDelay applied before sending to the secondary feed when both feeds are configured.
delayPolicyPolicy used to implement the secondary feed delay.
packetMaxSizeMaximum datagram payload size accepted by this target.
Exceptions
std::runtime_errorIf the recovery feed layout is unsupported or the primary feed endpoint is not populated.

◆ ~MulticastTarget()

Leaves joined multicast groups and releases owned multicast clients.

◆ MulticastTarget() [3/3]

MulticastTarget ( const MulticastTarget & )
delete

Member Function Documentation

◆ hasSecondary()

bool hasSecondary ( ) const
noexcept

Indicates whether the configured layout has a secondary feed.

◆ operator=()

MulticastTarget & operator= ( const MulticastTarget & )
delete

◆ primaryFeed()

NetFeedRole::Enum primaryFeed ( ) const
noexcept

Returns the feed role used as the primary feed.

◆ secondaryFeed()

NetFeedRole::Enum secondaryFeed ( ) const
noexcept

Returns the feed role used as the secondary feed.

◆ send()

Threading::Event send ( const void * data,
size_t dataSize )

Sends a datagram to the primary feed and sends to the secondary feed when it is configured.

When the secondary feed is sent asynchronously, the returned future becomes ready after the queued secondary send completes. Otherwise, the returned future is already ready after this method returns.

Parameters
dataPointer to the datagram payload.
dataSizePayload size in bytes.
Returns
Completion future for the asynchronous part of the send operation.
Exceptions
std::runtime_errorIf dataSize exceeds this target's packet size limit.

◆ sendA()

void sendA ( const void * data,
size_t dataSize )

Sends a datagram to feed A when feed A is configured.

Parameters
dataPointer to the datagram payload.
dataSizePayload size in bytes.
Exceptions
std::runtime_errorIf dataSize exceeds this target's packet size limit.

◆ sendB()

void sendB ( const void * data,
size_t dataSize )

Sends a datagram to feed B when feed B is configured.

Parameters
dataPointer to the datagram payload.
dataSizePayload size in bytes.
Exceptions
std::runtime_errorIf dataSize exceeds this target's packet size limit.

◆ sendPrimary()

void sendPrimary ( const void * data,
size_t dataSize )

Sends a datagram to the primary feed.

Parameters
dataPointer to the datagram payload.
dataSizePayload size in bytes.
Exceptions
std::runtime_errorIf dataSize exceeds this target's packet size limit.

◆ sendSecondary()

void sendSecondary ( const void * data,
size_t dataSize )

Sends a datagram immediately to the secondary feed when it is configured.

Parameters
dataPointer to the datagram payload.
dataSizePayload size in bytes.
Exceptions
std::runtime_errorIf dataSize exceeds this target's packet size limit.

Member Data Documentation

◆ DefaultMaxPacketSize

PacketSize DefaultMaxPacketSize = 1420
staticconstexpr

Default maximum datagram payload size accepted by a directly constructed multicast target.

Definition at line 38 of file MulticastSender.h.