Documentation
¶
Overview ¶
Package auto provides automatic DDS transport selection. It picks the best available transport for a given domain at participant creation time:
- TransportAuto (default): try shmem first; if unavailable or disabled, fall back to RTPS/UDP.
- TransportShmem: use shared-memory transport only; error if unavailable.
- TransportRTPS: use RTPS/UDP transport unconditionally; skip shmem.
Usage:
p, err := auto.NewParticipant(dds.Domain(0)) // shmem on same host, rtps when shmem is unavailable p, err := auto.NewParticipant(dds.Domain(0), auto.WithTransport(auto.TransportRTPS)) // always RTPS, e.g. for cross-host deployments
The returned participant satisfies dds.Participant and may optionally implement dds.MetricsProvider, dds.DiscoveryMetricsProvider, and dds.HealthProvider depending on the selected backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewParticipant ¶
NewParticipant creates a DDS participant on domain using the best available transport. The selection algorithm is determined by the WithTransport option (default: TransportAuto).
The returned participant satisfies dds.Participant. Callers can type-assert to dds.HealthProvider, dds.MetricsProvider, etc. depending on the backend.
Types ¶
type Option ¶
type Option func(*cfg)
Option configures the automatic transport selection.
func WithRTPSOpts ¶
WithRTPSOpts passes additional options to the RTPS participant when the RTPS transport is selected (either directly or as the auto fallback).
func WithTransport ¶
WithTransport overrides the default transport preference.
type Transport ¶
type Transport int
Transport identifies which DDS transport to use.
const ( // TransportAuto tries shmem first and falls back to RTPS/UDP if shmem is // unavailable. This is the default. TransportAuto Transport = iota // TransportShmem uses shared memory only. Returns an error if shmem cannot // be initialised (e.g. filesystem permissions, unsupported OS). TransportShmem // TransportRTPS always uses the RTPS/UDP transport regardless of whether // shmem is available. Use this for cross-host deployments. TransportRTPS )