Client

TODO

Client objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::protocols::udp::Client> rogue::protocols::udp::ClientPtr

The class description is shown below:

class Client : public rogue::protocols::udp::Core, public rogue::interfaces::stream::Master, public rogue::interfaces::stream::Slave

UDP stream endpoint that sends to and receives from a remote host.

Client combines UDP transport (udp::Core) with Rogue stream interfaces:

  • stream::Slave: accepts outbound frames and transmits them as UDP datagrams.

  • stream::Master: emits received UDP datagrams as Rogue frames.

A background receive thread continuously reads datagrams and forwards them downstream as frames from the local frame pool.

Public Functions

Client(std::string host, uint16_t port, bool jumbo)

Constructs a UDP client endpoint.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Resolves host address, creates UDP socket, initializes frame pool sizing, and starts background receive thread.

Parameters:
  • host – Remote hostname or IPv4 address.

  • port – Remote UDP port.

  • jumbotrue for jumbo payload sizing; false for standard MTU.

~Client()

Destroys the UDP client endpoint.

virtual void stop()

Stops the UDP client endpoint.

Stops receive thread, joins thread, and closes socket.

virtual void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Accepts an outbound stream frame and transmits it as UDP datagrams.

Each non-empty frame buffer payload is sent as a UDP datagram. Writes use select() with configured timeout; timeout/failure is logged.

Parameters:

frame – Outbound frame to transmit.

Public Static Functions

static std::shared_ptr<rogue::protocols::udp::Client> create(std::string host, uint16_t port, bool jumbo)

Creates a UDP client endpoint.

Parameter semantics are identical to the constructor; see Client() for endpoint setup behavior details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Parameters:
  • host – Remote hostname or IPv4 address.

  • port – Remote UDP port.

  • jumbotrue for jumbo payload sizing; false for standard MTU.

Returns:

Shared pointer to the created client.

static void setup_python()

Registers Python bindings for this class.