|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Abstract interface for IPv4 UDP datagram transport. More...
#include <IUdpSocket.h>
Inheritance diagram for profinet::IUdpSocket:
Collaboration diagram for profinet::IUdpSocket:Public Member Functions | |
| virtual | ~IUdpSocket ()=default |
| Virtual destructor for polymorphic use. | |
| virtual UdpDatagram | RecvFrom (std::size_t maxLen)=0 |
| Receive one UDP datagram and its source endpoint. | |
| virtual void | SendTo (const std::vector< std::uint8_t > &data, const UdpEndpoint &destination)=0 |
| Send a UDP datagram to a specific IPv4 endpoint. | |
| virtual void | SetTimeout (std::chrono::milliseconds timeout)=0 |
| Set the UDP receive timeout. | |
Abstract interface for IPv4 UDP datagram transport.
Provides the minimal UDP functionality required by protocol components that receive datagrams and send responses to their source endpoint.
Implementations may use a connected UDP socket for peer-specific communication or a bound UDP socket for listener-style communication. The protocol layer does not depend on the underlying operating-system socket API.
Example:
Definition at line 98 of file IUdpSocket.h.
|
virtualdefault |
Virtual destructor for polymorphic use.
|
pure virtual |
Receive one UDP datagram and its source endpoint.
Waits until a datagram is received or the configured receive timeout expires. A timeout is represented by an empty payload.
| maxLen | Maximum number of payload bytes to receive. |
| SocketError | When the underlying socket reports an error other than a receive timeout. |
Implemented in profinet::UdpSocket.
|
pure virtual |
Send a UDP datagram to a specific IPv4 endpoint.
| data | Datagram payload to transmit. |
| destination | IPv4 address and UDP port of the destination. |
| SocketError | When the endpoint is invalid or the datagram cannot be transmitted. |
Implemented in profinet::UdpSocket.
|
pure virtual |
Set the UDP receive timeout.
| timeout | Maximum time to wait for an incoming datagram. |
| SocketError | When the underlying socket option cannot be changed. |
Implemented in profinet::UdpSocket.