Client
Client is the outbound UDP endpoint class that maps stream frames to
datagrams and inbound datagrams to stream frames. This page is reference-only;
for deployment patterns see UDP Protocol Client.
Python binding
This C++ class is also exported into Python as rogue.protocols.udp.Client.
Python API page: - Client
objects in C++ are referenced by the following shared pointer typedef:
The class description is shown below:
-
class Client : public rogue::protocols::udp::Core, public rogue::interfaces::stream::Master, public rogue::interfaces::stream::Slave
[header] [source] UDP stream endpoint that sends to and receives from a remote host.
Clientcombines 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)
[header] [impl] Constructs a UDP client endpoint.
Creator.
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.
jumbo –
truefor jumbo payload sizing;falsefor standard MTU.
-
virtual void stop()
[header] [impl] Stops the UDP client endpoint.
Stops receive thread, joins thread, and closes socket.
Accepts an outbound stream frame and transmits it as UDP datagrams.
Accept a frame from master.
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)
[header] [impl] Creates a UDP client endpoint.
Class creation.
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 returnsstd::shared_ptrownership compatible with Rogue pointer typedefs.Company : SLAC National Accelerator Laboratory
Description: UDP
This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE.txt file.
- Parameters:
host – Remote hostname or IPv4 address.
port – Remote UDP port.
jumbo –
truefor jumbo payload sizing;falsefor standard MTU.
- Returns:
Shared pointer to the created client.