Core

Core provides shared UDP transport configuration used by Client and Server. This page is reference-only; for usage guidance see UDP Protocol.

Python binding

This C++ class is also exported into Python as rogue.protocols.udp.Core.

Python API page: - Core

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

typedef std::shared_ptr<rogue::protocols::udp::Core> rogue::protocols::udp::CorePtr
[header]

The class description is shown below:

class Core
[header]

Shared UDP transport base for stream client/server endpoints.

Core contains common socket and transport configuration used by UDP stream endpoints. It centralizes payload sizing (jumbo vs standard MTU), socket timeout configuration for transmit operations, receive-buffer sizing, and shared synchronization primitives used by derived classes.

Concrete data-path behavior (background receive thread, stream callbacks, and socket lifecycle) is implemented by udp::Client and udp::Server.

Subclassed by rogue::protocols::udp::Client, rogue::protocols::udp::Server

Public Functions

explicit Core(bool jumbo)
[header] [impl]

Constructs shared UDP core state.

Creator.

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:

jumbotrue to use jumbo-payload sizing; false for standard MTU.

~Core()
[header] [impl]

Destroys the UDP core instance.

Destructor.

void stop()
[header]

Stops the UDP interface.

Derived classes provide socket/thread shutdown behavior.

uint32_t maxPayload()
[header] [impl]

Returns maximum UDP payload size in bytes.

Return max payload.

Returns:

  • 8972 bytes when jumbo mode is enabled (MTU 9000).

  • 1472 bytes when jumbo mode is disabled (MTU 1500).

Returns:

Maximum payload size for configured MTU mode.

bool setRxBufferCount(uint32_t count)
[header] [impl]

Requests kernel UDP receive-buffer sizing by packet count.

Set UDP RX Size.

Computes count * mtu bytes and programs SO_RCVBUF. Returns false if the kernel effective receive buffer is smaller than requested.

Parameters:

count – Number of packets worth of RX buffering to request.

Returns:

true if effective buffer size meets/exceeds request.

void setTimeout(uint32_t timeout)
[header] [impl]

Sets outbound transmit wait timeout.

Set timeout for frame transmits in microseconds.

Timeout is specified in microseconds and converted to timeval for select()-based write readiness checks in derived endpoints.

Parameters:

timeout – Timeout in microseconds.

Public Static Functions

static void setup_python()
[header] [impl]

Registers Python bindings for this class.