|
rogue
|
UDP stream endpoint that listens on a local UDP port. More...
#include <Server.h>
Public Member Functions | |
| Server (uint16_t port, bool jumbo) | |
| Constructs a UDP server endpoint. | |
| ~Server () | |
| Destroys the UDP server endpoint. | |
| void | stop () |
| Stops the UDP server endpoint. | |
| uint32_t | getPort () |
| Returns bound local UDP port number. | |
| void | acceptFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame) |
| Accepts an outbound stream frame and transmits it as UDP datagrams. | |
Public Member Functions inherited from rogue::protocols::udp::Core | |
| Core (bool jumbo) | |
| Constructs shared UDP core state. | |
| ~Core () | |
| Destroys the UDP core instance. | |
| void | stop () |
| Stops the UDP interface. | |
| uint32_t | maxPayload () |
| Returns maximum UDP payload size in bytes. | |
| bool | setRxBufferCount (uint32_t count) |
| Requests kernel UDP receive-buffer sizing by packet count. | |
| void | setTimeout (uint32_t timeout) |
| Sets outbound transmit wait timeout. | |
Public Member Functions inherited from rogue::interfaces::stream::Master | |
| Master () | |
| Constructs a stream master. | |
| virtual | ~Master () |
| Destroys the stream master. | |
| uint32_t | slaveCount () |
| Returns the number of attached slaves. | |
| void | addSlave (std::shared_ptr< rogue::interfaces::stream::Slave > slave) |
| Attaches a downstream slave. | |
| std::shared_ptr< rogue::interfaces::stream::Frame > | reqFrame (uint32_t size, bool zeroCopyEn) |
| Requests allocation of a new frame from the primary slave. | |
| void | sendFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame) |
| Sends a frame to all attached slaves. | |
| bool | ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn) |
| Ensures a frame is represented by a single buffer. | |
| void | equalsPy (boost::python::object p) |
Supports == operator usage from Python. | |
| boost::python::object | rshiftPy (boost::python::object p) |
Supports >> operator usage from Python. | |
| void | operator== (std::shared_ptr< rogue::interfaces::stream::Slave > &other) |
Supports == operator usage in C++. | |
| std::shared_ptr< rogue::interfaces::stream::Slave > & | operator>> (std::shared_ptr< rogue::interfaces::stream::Slave > &other) |
| Connects this master to a slave via stream chaining operator. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > | |
| std::shared_ptr< rogue::interfaces::stream::Master > | shared_from_this () |
Returns a shared_ptr<T> for this instance. | |
Public Member Functions inherited from rogue::EnableSharedFromThisBase | |
| virtual | ~EnableSharedFromThisBase () |
| Virtual destructor for polymorphic base usage. | |
Public Member Functions inherited from rogue::interfaces::stream::Slave | |
| Slave () | |
| Constructs a stream slave. | |
| virtual | ~Slave () |
| Destroys the stream slave. | |
| void | setDebug (uint32_t debug, std::string name) |
| Sets debug message verbosity and logger name. | |
| uint64_t | getFrameCount () |
| Returns frame counter. | |
| uint64_t | getByteCount () |
| Returns byte counter. | |
| bool | ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn) |
| Ensures frame is backed by a single buffer. | |
| std::shared_ptr< rogue::interfaces::stream::Frame > | reqLocalFrame (uint32_t size, bool zeroCopyEn) |
| Services a local frame allocation request through this object's pool interface. | |
| boost::python::object | lshiftPy (boost::python::object p) |
Supports << operator usage from Python. | |
| std::shared_ptr< rogue::interfaces::stream::Master > & | operator<< (std::shared_ptr< rogue::interfaces::stream::Master > &other) |
| Connects this slave to a master via stream chaining operator. | |
Public Member Functions inherited from rogue::interfaces::stream::Pool | |
| Pool () | |
| Constructs a pool with default allocation behavior enabled. | |
| virtual | ~Pool () |
| Destroys the pool and releases any cached buffer storage. | |
| uint32_t | getAllocBytes () |
| Returns total currently allocated bytes. | |
| uint32_t | getAllocCount () |
| Returns total currently allocated buffer count. | |
| virtual std::shared_ptr< rogue::interfaces::stream::Frame > | acceptReq (uint32_t size, bool zeroCopyEn) |
| Services a frame allocation request from a master. | |
| virtual void | retBuffer (uint8_t *data, uint32_t meta, uint32_t size) |
| Returns buffer data to the allocator. | |
| void | setFixedSize (uint32_t size) |
| Sets fixed-size mode. | |
| uint32_t | getFixedSize () |
| Returns fixed-size allocation setting. | |
| void | setPoolSize (uint32_t size) |
| Sets buffer pool size. | |
| uint32_t | getPoolSize () |
| Returns configured maximum number of cached pool entries. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool > | |
| std::shared_ptr< rogue::interfaces::stream::Pool > | shared_from_this () |
Returns a shared_ptr<T> for this instance. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave > | |
| std::shared_ptr< rogue::interfaces::stream::Slave > | shared_from_this () |
Returns a shared_ptr<T> for this instance. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::protocols::udp::Server > | create (uint16_t port, bool jumbo) |
| Creates a UDP server endpoint. | |
| static void | setup_python () |
| Registers Python bindings for this class. | |
Static Public Member Functions inherited from rogue::protocols::udp::Core | |
| static void | setup_python () |
| Registers Python bindings for this class. | |
Static Public Member Functions inherited from rogue::interfaces::stream::Master | |
| static std::shared_ptr< rogue::interfaces::stream::Master > | create () |
| Creates a stream master. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Static Public Member Functions inherited from rogue::interfaces::stream::Slave | |
| static std::shared_ptr< rogue::interfaces::stream::Slave > | create () |
| Creates a new stream slave. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Static Public Member Functions inherited from rogue::interfaces::stream::Pool | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Additional Inherited Members | |
Protected Member Functions inherited from rogue::interfaces::stream::Pool | |
| std::shared_ptr< rogue::interfaces::stream::Buffer > | allocBuffer (uint32_t size, uint32_t *total) |
| Allocate a buffer passed size. | |
| std::shared_ptr< rogue::interfaces::stream::Buffer > | createBuffer (void *data, uint32_t meta, uint32_t size, uint32_t alloc) |
| Creates a Buffer with a pre-allocated data block. | |
| void | decCounter (uint32_t alloc) |
| Decrements allocation counter. | |
Protected Attributes inherited from rogue::protocols::udp::Core | |
| std::shared_ptr< rogue::Logging > | udpLog_ |
| bool | jumbo_ |
| int32_t | fd_ |
| struct sockaddr_in | remAddr_ |
| struct timeval | timeout_ |
| std::thread * | thread_ |
| bool | threadEn_ |
| std::mutex | udpMtx_ |
UDP stream endpoint that listens on a local UDP port.
Server combines UDP transport (udp::Core) with Rogue stream interfaces:
stream::Slave: accepts outbound frames and transmits datagrams to the most recently seen remote endpoint.stream::Master: emits inbound datagrams as Rogue frames.A background receive thread listens on the bound UDP socket, forwards payloads as frames, and updates remote endpoint address when packets are received.
| rogue::protocols::udp::Server::Server | ( | uint16_t | port, |
| bool | jumbo | ||
| ) |
Constructs a UDP server endpoint.
Creator.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
Creates and binds UDP socket, initializes frame pool sizing, and starts background receive thread. If port == 0, the OS-assigned port is queried and stored.
| port | Local UDP port to bind (0 requests dynamic port assignment). |
| jumbo | true for jumbo payload sizing; false for standard MTU. |
Definition at line 52 of file Server.cpp.
| rogue::protocols::udp::Server::~Server | ( | ) |
|
virtual |
Accepts an outbound stream frame and transmits it as UDP datagrams.
Accept a frame from master.
Datagrams are sent to the current remote endpoint address learned by the receive thread. Writes use select() with configured timeout.
| frame | Outbound frame to transmit. |
Reimplemented from rogue::interfaces::stream::Slave.
Definition at line 122 of file Server.cpp.
|
static |
Creates a UDP server endpoint.
Class creation.
Parameter semantics are identical to the constructor; see Server() 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.
| port | Local UDP port to bind (0 requests dynamic port assignment). |
| jumbo | true for jumbo payload sizing; false for standard MTU. |
Description:
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
Definition at line 46 of file Server.cpp.
| uint32_t rogue::protocols::udp::Server::getPort | ( | ) |
Returns bound local UDP port number.
Get port number.
Definition at line 117 of file Server.cpp.
|
static |
Registers Python bindings for this class.
Definition at line 239 of file Server.cpp.
|
virtual |
Stops the UDP server endpoint.
Stops receive thread, joins thread, and closes socket.
Reimplemented from rogue::interfaces::stream::Master.
Definition at line 107 of file Server.cpp.