![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
An asynchronous network source transport that reconstructs messages from UDP frames. More...
#include <dfx-core/transports/sources/UdpSource.hpp>
Public Member Functions | |
| void | start (FdWatch::Poller &poller) override |
| Initializes the UDP socket and attaches it to the poller. | |
| void | stop () noexcept override |
| Stops the transport and cleans up resources. | |
| SourceTransport (Endpoint endpoint, nlohmann::json config) | |
| Constructs a SourceTransport with the Role::Source role. | |
| Public Member Functions inherited from dfx::Core::SourceTransport | |
| SourceTransport (Endpoint endpoint, nlohmann::json config) | |
| Constructs a SourceTransport with the Role::Source role. | |
| Public Member Functions inherited from dfx::Core::Transport | |
| Transport (Role role, Endpoint endpoint, nlohmann::json config) | |
| Constructs a transport instance. | |
| DFX_DISABLE_COPY_AND_MOVE (Transport) | |
| Transport is not copiable nor movable. | |
| virtual | ~Transport ()=default |
| Virtual destructor ensuring proper cleanup of derived transports. | |
| template<DerivedFromTransport T> | |
| bool | is () const noexcept |
| Check whether this transport is of a given derived type. | |
| template<DerivedFromTransport T> | |
| T & | as () noexcept |
| Cast this transport to a derived type (unchecked). | |
| template<DerivedFromTransport T> | |
| T const & | as () const noexcept |
| Cast this transport to a derived type (unchecked). | |
| Role | role () const noexcept |
| Returns the Role (Source or Destination) of this transport. | |
| bool | isSource () const noexcept |
| Returns true if this transport is a source. | |
| bool | isDestination () const noexcept |
| Returns true if this transport is a destination. | |
| Endpoint const & | endpoint () const noexcept |
| Gets the endpoint descriptor associated with this transport. | |
| Channel * | channel () const noexcept |
| Gets the channel which this transport is attached to if any. | |
| Port * | port () const noexcept |
| Gets the port associated with this transport. | |
| NodePtr | node () const noexcept |
| Gets the node associated with this transport. | |
| nlohmann::json const & | config () const noexcept |
| Gets the JSON configuration used to initialize this transport. | |
Additional Inherited Members | |
| Public Types inherited from dfx::Core::Transport | |
| enum class | Role { Source , Destination } |
| Defines the operational role of a transport relative to a channel. More... | |
| Protected Member Functions inherited from dfx::Core::SourceTransport | |
| bool | transmitMessage (MessagePtr message) |
| Forwards a message to the attached Channel for orchestration. | |
| Protected Attributes inherited from dfx::Core::Transport | |
| Role const | _role |
| Endpoint | _endpoint |
| nlohmann::json | _config |
An asynchronous network source transport that reconstructs messages from UDP frames.
UdpSource serves as the receiving endpoint for UDP-based communication. Since UDP is a datagram-oriented protocol that does not guarantee ordering or delivery, this class coordinates with details::Framer to handle the reassembly of fragmented messages.
|
inline |
Constructs a SourceTransport with the Role::Source role.
| endpoint | The originating endpoint descriptor. |
| config | Additional JSON configuration specific to this transport instance. |
|
overridevirtual |
Initializes the UDP socket and attaches it to the poller.
Creates a server-side UDP socket bound to the configured address. Registers a read callback with the poller. Configures the cleanup timer for recurring stale-frame checks.
| poller | The poller responsible for monitoring the socket FD. |
Implements dfx::Core::Transport.
|
overridevirtualnoexcept |
Stops the transport and cleans up resources.
Implements dfx::Core::Transport.