#include <OnixS/CME/MDH/testing/MulticastFeed.h>
Protected Types | |
| enum | : std::size_t |
Protected Member Functions | |
| MulticastDelivery (NetFeedType::Enum target, const FeedSettings &feedSettings=generateFeedSettings(), Messaging::TimeSpan arbitrageDelay=Messaging::TimeSpan{}, ReplayDelayer &delayPolicy=CombinedReplayDelayer::service(), const MulticastTargetOptions &options=MulticastTargetOptions{}) | |
| ~MulticastDelivery () | |
| Threading::Event | send (const ByteSpan packet[], std::size_t spansCount) |
| void | sendPrimary (const ByteSpan packet[], std::size_t spansCount) |
| void | sendSecondary (const ByteSpan packet[], std::size_t spansCount) |
| NetFeedRole::Enum | primaryFeed () const noexcept |
| NetFeedRole::Enum | secondaryFeed () const noexcept |
| bool | hasSecondary () const noexcept |
This class is a delivery policy and cannot be constructed or used directly. MulticastFeed exposes its operations as a packet-building feed. The policy sends to the primary endpoint synchronously and sends to the secondary endpoint synchronously or asynchronously according to its delay configuration. Targeted primary and secondary sends are synchronous and do not apply the configured arbitrage delay.
Definition at line 41 of file MulticastFeed.h.
|
protected |
Maximum number of byte spans accepted by the multicast target.
| Enumerator | ||
|---|---|---|
| MaxSpansCount | MulticastTarget::MaxSpansCount | |
Definition at line 45 of file MulticastFeed.h.
|
explicitprotected |
Creates and joins the multicast target for one network feed type.
An asynchronous secondary sender is created only when the selected layout configures a secondary endpoint and the delay is at least one microsecond. Smaller delays send synchronously.
| target | Feed type whose multicast connection settings are used. |
| feedSettings | Feed settings containing the target's layout, endpoints, network interfaces, and packet size limit. |
| arbitrageDelay | Delay applied before sending to the secondary feed when both feeds are configured. |
| delayPolicy | Policy used to implement an asynchronous secondary-feed delay. The referenced object must outlive this multicast feed. |
| options | Multicast socket options applied to the target. |
| std::runtime_error | If the requested feed is unsupported or has no configured endpoint, its layout is unsupported, or an effective endpoint does not contain a valid IPv4 multicast group, port, and explicit network interface. |
| std::invalid_argument | If a positive TTL is not authorized through ONIXS_CMEMDH_ALLOW_MULTICAST_EGRESS, or an outgoing destination outside 239.0.0.0/8 is not authorized through ONIXS_CMEMDH_ALLOW_ANY_MULTICAST_DESTINATION. |
| Any | exception thrown while creating or joining a multicast client. |
|
protected |
Drains queued secondary sends and releases the multicast target.
|
protectednoexcept |
Indicates whether the complementary endpoint is configured.
|
protectednoexcept |
Identifies the endpoint used for primary transmissions.
|
protectednoexcept |
Identifies the role complementary to the primary feed.
|
protected |
Sends a complete packet to the configured multicast feeds.
The primary UDP send completes before this method returns. When the secondary send is queued, the returned event becomes ready after it completes and Threading::Event::get() propagates its failure. Otherwise, the event is ready on return.
| packet | Packet spans, beginning with the packet header. |
| spansCount | Number of spans in packet. |
| std::runtime_error | If the packet exceeds the configured size limit, the asynchronous secondary-send queue is saturated, or a synchronous UDP send fails. |
|
protected |
Sends a complete packet synchronously to the primary feed.
| packet | Packet spans, beginning with the packet header. |
| spansCount | Number of spans in packet. |
| std::runtime_error | If the packet exceeds the configured size limit or the UDP send fails. |
|
protected |
Sends a complete packet synchronously to the secondary feed.
| packet | Packet spans, beginning with the packet header. |
| spansCount | Number of spans in packet. |
| std::runtime_error | If the packet exceeds the configured size limit or the UDP send fails. |