rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
rogue::protocols::udp::Core Class Reference

Shared UDP transport base for stream client/server endpoints. More...

#include <Core.h>

Inheritance diagram for rogue::protocols::udp::Core:
rogue::protocols::udp::Client rogue::protocols::udp::Server

Public Member Functions

 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.
 

Static Public Member Functions

static void setup_python ()
 Registers Python bindings for this class.
 

Protected Attributes

std::shared_ptr< rogue::LoggingudpLog_
 
bool jumbo_
 
int32_t fd_
 
struct sockaddr_in remAddr_
 
struct timeval timeout_
 
std::thread * thread_
 
bool threadEn_
 
std::mutex udpMtx_
 

Detailed Description

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.

Definition at line 61 of file Core.h.

Constructor & Destructor Documentation

◆ Core()

rogue::protocols::udp::Core::Core ( bool  jumbo)
explicit

Constructs shared UDP core state.

Creator.

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

Company : SLAC National Accelerator Laboratory

Description:

UDP Core

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.

Definition at line 36 of file Core.cpp.

◆ ~Core()

rogue::protocols::udp::Core::~Core ( )

Destroys the UDP core instance.

Destructor.

Definition at line 42 of file Core.cpp.

Member Function Documentation

◆ maxPayload()

uint32_t rogue::protocols::udp::Core::maxPayload ( )

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.

Definition at line 45 of file Core.cpp.

◆ setRxBufferCount()

bool rogue::protocols::udp::Core::setRxBufferCount ( uint32_t  count)

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
countNumber of packets worth of RX buffering to request.
Returns
true if effective buffer size meets/exceeds request.

Definition at line 50 of file Core.cpp.

◆ setTimeout()

void rogue::protocols::udp::Core::setTimeout ( uint32_t  timeout)

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
timeoutTimeout in microseconds.

Definition at line 72 of file Core.cpp.

◆ setup_python()

void rogue::protocols::udp::Core::setup_python ( )
static

Registers Python bindings for this class.

Definition at line 78 of file Core.cpp.

◆ stop()

void rogue::protocols::udp::Core::stop ( )

Stops the UDP interface.

Derived classes provide socket/thread shutdown behavior.

Member Data Documentation

◆ fd_

int32_t rogue::protocols::udp::Core::fd_
protected

Definition at line 69 of file Core.h.

◆ jumbo_

bool rogue::protocols::udp::Core::jumbo_
protected

Definition at line 66 of file Core.h.

◆ remAddr_

struct sockaddr_in rogue::protocols::udp::Core::remAddr_
protected

Definition at line 72 of file Core.h.

◆ thread_

std::thread* rogue::protocols::udp::Core::thread_
protected

Definition at line 77 of file Core.h.

◆ threadEn_

bool rogue::protocols::udp::Core::threadEn_
protected

Definition at line 78 of file Core.h.

◆ timeout_

struct timeval rogue::protocols::udp::Core::timeout_
protected

Definition at line 75 of file Core.h.

◆ udpLog_

std::shared_ptr<rogue::Logging> rogue::protocols::udp::Core::udpLog_
protected

Definition at line 63 of file Core.h.

◆ udpMtx_

std::mutex rogue::protocols::udp::Core::udpMtx_
protected

Definition at line 81 of file Core.h.


The documentation for this class was generated from the following files: