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:
The class description is shown below:
-
class Core
[header] Shared UDP transport base for stream client/server endpoints.
Corecontains common socket and transport configuration used by UDP stream endpoints. It centralizes payload sizing (jumbovs 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::Clientandudp::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:
jumbo –
trueto use jumbo-payload sizing;falsefor standard MTU.
-
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:
8972bytes when jumbo mode is enabled (MTU 9000).1472bytes 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 * mtubytes and programsSO_RCVBUF. Returnsfalseif the kernel effective receive buffer is smaller than requested.- Parameters:
count – Number of packets worth of RX buffering to request.
- Returns:
trueif 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
timevalforselect()-based write readiness checks in derived endpoints.- Parameters:
timeout – Timeout in microseconds.
-
explicit Core(bool jumbo)