Skip to main content

Client

netft::Client owns configuration discovery, one RDT session, recovery, health accounting, and sample delivery. Constructing it validates configuration but does not start network activity.

netft::Client

class NETFT_API Client;

Member functions

Client

explicit Client(Config config);
ParameterTypeDefault
configConfigRequired

~Client

~Client();

start

void start(SampleCallback callback);
ParameterTypeDefault
callbackSampleCallbackRequired

Returns: void

stop

void stop() noexcept;

Returns: void

Qualifiers: noexcept

bias

void bias();

Returns: void

wait_for_first_sample

bool wait_for_first_sample(std::chrono::duration<double> timeout);
ParameterTypeDefault
timeoutstd::chrono::duration<double>Required

Returns: bool

faulted

[[nodiscard]] bool faulted() const noexcept;

Returns: bool

Qualifiers: constnoexcept

fault_code

[[nodiscard]] FaultCode fault_code() const noexcept;

Returns: FaultCode

Qualifiers: constnoexcept

health

[[nodiscard]] HealthSnapshot health() const;

Returns: HealthSnapshot

Qualifiers: const

latest_sample

[[nodiscard]] std::optional<Sample> latest_sample() const;

Returns: std::optional<Sample>

Qualifiers: const

Lifecycle and concurrencyโ€‹

Call start() once for a run and keep its callback bounded. The callback executes on the native receive worker, so blocking storage or application work must be transferred to an application-owned bounded queue. stop() is idempotent and non-throwing.

Destruction normally waits for worker shutdown. Destruction initiated by the sample callback cannot join its own thread, so shutdown and storage reclamation are deferred; the callback must not access the client after initiating destruction.

The type is neither copyable nor movable. latest_sample() does not consume delivery, and health() returns a point-in-time snapshot. Use structured state, fault code, status, and counters for decisions rather than parsing last_error.

Readinessโ€‹

wait_for_first_sample() is a bounded readiness check for the current run. A false result establishes only that a sample was not observed before the boundary; inspect faulted(), fault_code(), and health() to distinguish timeout, stop, and a terminal fail-stop fault.

See alsoโ€‹