16#include "DestinationTransport.hpp"
17#include <dfx-fdwatch/PollerFd.hpp>
39 enum class WriteResult
67 void stop() noexcept override;
86 WriteResult _writeData(
std::vector<uint8_t> data);
93 std::uniform_int_distribution<uint32_t> _messageIdGen;
98 bool _canWrite = false;
99 std::queue<
std::vector<uint8_t>> _pendingData;
DestinationTransport(Endpoint endpoint, nlohmann::json config)
Constructs a DestinationTransport with the Role::Destination role.
Definition DestinationTransport.hpp:32
Definition Endpoint.hpp:24
Endpoint const & endpoint() const noexcept
Gets the endpoint descriptor associated with this transport.
Definition Transport.hpp:161
nlohmann::json const & config() const noexcept
Gets the JSON configuration used to initialize this transport.
Definition Transport.hpp:176
bool deliver(MessagePtr message) override
Delivers a message over the network.
void stop() noexcept override
Closes the socket and releases resources.
UdpDestination(Endpoint endpoint, nlohmann::json config)
Constructs a UdpDestination.
static constexpr auto defaultMtuNetworkOverhead
Prepares the UDP socket and performs initial MTU discovery.
Definition UdpDestination.hpp:49
void start(FdWatch::Poller &poller) override
Initializes the UDP socket and enables PMTUD.
Bitset wrapper for dfx::FdWatch::EventTrigger values.
Abstract interface for FD-based event polling.
Definition Poller.hpp:37
Definition Channel.hpp:25
std::unique_ptr< Message > MessagePtr
Unique ownership handle for messages.
Definition Message.hpp:27
Definition SocketClient.hpp:23