|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Null implementation for when UDP transport is disabled. More...
#include <udp_client_interface.h>


Public Member Functions | |
| ::kcenon::common::VoidResult | connect (const std::string &, uint16_t) override |
| Connect to a remote endpoint for optimized sending. | |
| ::kcenon::common::VoidResult | send (std::span< const uint8_t >) override |
| Send data to the connected endpoint. | |
| ::kcenon::common::VoidResult | send_to (std::span< const uint8_t >, const udp_endpoint &) override |
| Send data to a specific endpoint (connectionless) | |
| bool | is_connected () const override |
| Check if the client is connected to an endpoint. | |
| void | disconnect () override |
| Disconnect from the current endpoint. | |
| std::string | get_implementation_name () const override |
| Get the implementation name for logging/debugging. | |
Public Member Functions inherited from kcenon::common::interfaces::IUdpClient | |
| virtual | ~IUdpClient ()=default |
| virtual::kcenon::common::VoidResult | connect (const udp_endpoint &endpoint) |
| Connect to a remote endpoint. | |
| virtual::kcenon::common::VoidResult | send (std::span< const uint8_t > data, const udp_send_options &options) |
| Send data to the connected endpoint with options. | |
| virtual std::optional< udp_endpoint > | get_remote_endpoint () const |
| Get the currently connected endpoint. | |
| virtual udp_statistics | get_statistics () const |
| Get send statistics. | |
| virtual void | reset_statistics () |
| Reset statistics. | |
| ::kcenon::common::VoidResult | send (const std::string &data) |
| Send string data to the connected endpoint. | |
| ::kcenon::common::VoidResult | send_to (const std::string &data, const udp_endpoint &endpoint) |
| Send string data to a specific endpoint. | |
Null implementation for when UDP transport is disabled.
This implementation always returns errors, useful for testing or when UDP functionality is intentionally disabled.
Definition at line 273 of file udp_client_interface.h.
|
inlineoverridevirtual |
Connect to a remote endpoint for optimized sending.
This establishes a "connected" UDP socket, which allows the kernel to cache routing information and perform error checking.
| host | Remote hostname or IP address |
| port | Remote port number |
Implements kcenon::common::interfaces::IUdpClient.
Definition at line 275 of file udp_client_interface.h.
References kcenon::common::error_codes::NOT_INITIALIZED.
|
inlineoverridevirtual |
Disconnect from the current endpoint.
After disconnecting, send() will fail until connect() is called again. send_to() can still be used for connectionless sends.
Implements kcenon::common::interfaces::IUdpClient.
Definition at line 301 of file udp_client_interface.h.
|
inlinenodiscardoverridevirtual |
Get the implementation name for logging/debugging.
Implements kcenon::common::interfaces::IUdpClient.
Definition at line 303 of file udp_client_interface.h.
|
inlinenodiscardoverridevirtual |
Check if the client is connected to an endpoint.
Implements kcenon::common::interfaces::IUdpClient.
Definition at line 297 of file udp_client_interface.h.
|
inlineoverridevirtual |
Send data to the connected endpoint.
Requires a prior successful call to connect().
| data | Data to send |
Implements kcenon::common::interfaces::IUdpClient.
Definition at line 282 of file udp_client_interface.h.
References kcenon::common::error_codes::NOT_INITIALIZED.
|
inlineoverridevirtual |
Send data to a specific endpoint (connectionless)
Sends data without requiring a prior connect() call.
| data | Data to send |
| endpoint | Target endpoint |
Implements kcenon::common::interfaces::IUdpClient.
Definition at line 289 of file udp_client_interface.h.
References kcenon::common::error_codes::NOT_INITIALIZED.