rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::interfaces::stream::TcpServer Class Reference

Stream TCP bridge server. More...

#include <TcpServer.h>

Inheritance diagram for rogue::interfaces::stream::TcpServer:
rogue::interfaces::stream::TcpCore rogue::interfaces::stream::Master rogue::interfaces::stream::Slave rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > rogue::interfaces::stream::Pool rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThisBase

Public Member Functions

 TcpServer (std::string addr, uint16_t port)
 Constructs a TCP stream bridge server.
 
 ~TcpServer ()
 Destroys the TCP server.
 
- Public Member Functions inherited from rogue::interfaces::stream::TcpCore
 TcpCore (const std::string &addr, uint16_t port, bool server)
 Constructs a TCP stream bridge core.
 
 ~TcpCore ()
 Destroys the bridge core and releases resources.
 
void close ()
 Closes active bridge connections.
 
void stop ()
 Stops the interface and worker thread.
 
void acceptFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Receives a frame from upstream and forwards over the TCP bridge.
 
- 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::FramereqFrame (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::Mastershared_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::FramereqLocalFrame (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::FrameacceptReq (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::Poolshared_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::Slaveshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 

Static Public Member Functions

static std::shared_ptr< rogue::interfaces::stream::TcpServercreate (std::string addr, uint16_t port)
 Factory method to create a TCP stream bridge server.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::TcpCore
static std::shared_ptr< rogue::interfaces::stream::TcpCorecreate (const std::string &addr, uint16_t port, bool server)
 Creates a TCP stream bridge core instance and returns it as TcpCorePtr.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Master
static std::shared_ptr< rogue::interfaces::stream::Mastercreate ()
 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::Slavecreate ()
 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::TcpCore
void runThread ()
 Run thread.
 
- Protected Member Functions inherited from rogue::interfaces::stream::Pool
std::shared_ptr< rogue::interfaces::stream::BufferallocBuffer (uint32_t size, uint32_t *total)
 Allocate a buffer passed size.
 
std::shared_ptr< rogue::interfaces::stream::BuffercreateBuffer (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::interfaces::stream::TcpCore
std::string pullAddr_
 
std::string pushAddr_
 
void * zmqCtx_
 
void * zmqPull_
 
void * zmqPush_
 
std::shared_ptr< rogue::LoggingbridgeLog_
 
std::thread * thread_
 
bool threadEn_
 
std::mutex bridgeMtx_
 

Detailed Description

Stream TCP bridge server.

Thin wrapper around TcpCore configured for server mode.

Definition at line 42 of file TcpServer.h.

Constructor & Destructor Documentation

◆ TcpServer()

rogue::interfaces::stream::TcpServer::TcpServer ( std::string  addr,
uint16_t  port 
)

Constructs a TCP stream bridge server.

Creator.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

The address can be an IP address or hostname and selects the local bind interface. A value of "*" binds all interfaces. The bridge uses two consecutive TCP ports; port is the base (for example, port=8000 uses 8000 and 8001).

Parameters
addrLocal bind address.
portBase TCP port number.

Definition at line 48 of file TcpServer.cpp.

◆ ~TcpServer()

rogue::interfaces::stream::TcpServer::~TcpServer ( )

Destroys the TCP server.

Destructor.

Definition at line 51 of file TcpServer.cpp.

Member Function Documentation

◆ create()

rogue::interfaces::stream::TcpServerPtr rogue::interfaces::stream::TcpServer::create ( std::string  addr,
uint16_t  port 
)
static

Factory method to create a TCP stream bridge server.

Class creation.

Parameter semantics are identical to the constructor; see TcpServer() for address and port behavior details. Exposed in Python as rogue.interfaces.stream.TcpServer. 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.

Parameters
addrInterface address for the server.
portBase TCP port number for the bridge.
Returns
Shared pointer (TcpServerPtr) to the created server.

Company : SLAC National Accelerator Laboratory

Description:

Stream Network Server

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 42 of file TcpServer.cpp.

◆ setup_python()

void rogue::interfaces::stream::TcpServer::setup_python ( )
static

Registers this type with Python bindings.

Definition at line 53 of file TcpServer.cpp.


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