Network Utilities#

These transport classes expose the lower-level UDP layer used by the SDK’s real-time path. Most application code will stay at rb::Robot<T>, but these types are useful when you need direct transport control.

Headers

Type

Header

rb::UdpClient

#include <rby1-sdk/net/udp_client.h>

rb::UdpIPv4Client and rb::UdpIPv6Client

#include <rby1-sdk/net/udp_client.h>

rb::UdpServer

#include <rby1-sdk/net/udp_server.h>

Public Member Functions

Type or method group

Purpose

Notes

rb::UdpClient

Base transport interface for SendTo(...) and RecvFrom(...).

Implemented by the IPv4 and IPv6 client classes.

rb::UdpIPv4Client and rb::UdpIPv6Client

Connect to a specific remote UDP endpoint and send or receive packets.

Choose the variant that matches the target address family.

rb::UdpServer

Bind a local UDP socket, receive packets, and reply to clients.

Useful for protocol tools and custom RT experiments.

Detailed Reference

class UdpClient#

Subclassed by rb::UdpIPv4Client, rb::UdpIPv6Client

Public Functions

virtual int RecvFrom(unsigned char *buffer, size_t max_buf_size) const = 0#
virtual void SendTo(unsigned char *buffer, size_t buf_size) const = 0#
class UdpIPv4Client : public rb::UdpClient#

Public Functions

inline UdpIPv4Client(std::string ip, int port)#
inline ~UdpIPv4Client()#
inline virtual int RecvFrom(unsigned char *buffer, size_t max_buf_size) const override#
inline virtual void SendTo(unsigned char *buffer, size_t buf_size) const override#
class UdpIPv6Client : public rb::UdpClient#

Public Functions

inline UdpIPv6Client(std::string ip, int port)#
inline ~UdpIPv6Client()#
inline virtual int RecvFrom(unsigned char *buffer, size_t max_buf_size) const override#
inline virtual void SendTo(unsigned char *buffer, size_t buf_size) const override#
class UdpServer#

Public Functions

inline explicit UdpServer(const int port = 0)#
inline ~UdpServer()#
inline void ClearBuffer() const#
inline int GetPort() const#
inline int RecvFrom(unsigned char *buffer, size_t max_buf_size, struct sockaddr_storage &client_addr) const#
inline void SendTo(unsigned char *buffer, size_t buf_size, const struct sockaddr_storage &client_addr) const#

Related Types

Examples

  • real_time_control_command.cpp

  • rtcomm_protocol.cpp