dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
UdpSource.hpp
1// SPDX-FileCopyrightText: 2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Project includes
12#include "../../details/Framer.hpp"
13#include "SourceTransport.hpp"
14#include <dfx-fdwatch/PollerFd.hpp>
15#include <dfx-fdwatch/Timer.hpp>
16
17namespace dfx::Core
18{
33{
34public:
36
37public:
45 void start(FdWatch::Poller & poller) override;
47 void stop() noexcept override;
48
49private:
50 void _onSocketReadyRead(FdWatch::EventTriggers events);
51 void _onCleanupTimerTimeout();
52
53private:
54 FdWatch::PollerFd _socket;
55 details::Framer _framer;
56 FdWatch::Timer _cleanupTimer;
57
58private:
59 std::vector<uint8_t> _memory;
60};
61} // !namespace dfx::Core
SourceTransport(Endpoint endpoint, nlohmann::json config)
Constructs a SourceTransport with the Role::Source role.
Definition SourceTransport.hpp:31
An asynchronous network source transport that reconstructs messages from UDP frames.
Definition UdpSource.hpp:33
SourceTransport(Endpoint endpoint, nlohmann::json config)
Constructs a SourceTransport with the Role::Source role.
Definition SourceTransport.hpp:31
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.
Bitset wrapper for dfx::FdWatch::EventTrigger values.
Abstract interface for FD-based event polling.
Definition Poller.hpp:37
Definition Framer.hpp:45
Definition Channel.hpp:25
Definition SocketClient.hpp:23
STL namespace.