28 void Open(
const std::string& address, std::uint16_t port,
bool isListener =
false)
override;
39 void SendTo(
const Bytes& data,
const asio::ip::udp::endpoint& targetEndpoint)
override;
54 void Close()
noexcept override;
58 [[nodiscard]]
bool IsOpen()
const noexcept;
Synchronous UDP transport used by PROFINET DCE/RPC.
void SendTo(const Bytes &data, const asio::ip::udp::endpoint &targetEndpoint) override
Send a UDP datagram to a specific remote endpoint.
bool IsOpen() const noexcept
Check whether the socket is open.
asio::io_context & ioContext
void Open(const std::string &address, std::uint16_t port, bool isListener=false) override
Open the UDP socket and configure the remote endpoint.
asio::ip::udp::socket socket
Bytes SendReceive(const Bytes &data, std::chrono::milliseconds timeout) override
Send a UDP datagram and wait for one response.
void Close() noexcept override
Close the UDP socket.
void Send(const Bytes &data) override
Send a UDP datagram without waiting for a response.
Bytes Receive(std::chrono::milliseconds timeout, asio::ip::udp::endpoint &remoteEndpoint) override
Wait for an incoming UDP datagram and capture the sender's endpoint.
asio::ip::udp::endpoint endpoint
std::vector< std::uint8_t > Bytes
Generic byte buffer alias used throughout the library for raw wire data.
PROFINET protocol wire-format structures and serialization helpers.
asio::ip::udp::endpoint remoteEndpoint