TcpServer
For conceptual guidance on memory transport usage, see:
Python binding
This C++ class is also exported into Python as rogue.interfaces.memory.TcpServer.
Python API page: - TcpServer
objects in C++ are referenced by the following shared pointer typedef:
-
typedef std::shared_ptr<rogue::interfaces::memory::TcpServer> rogue::interfaces::memory::TcpServerPtr
[header] Shared pointer alias for
TcpServer.
The class description is shown below:
-
class TcpServer : public rogue::interfaces::memory::Master
[header] Memory TCP bridge server.
Implements the server side of the memory TCP bridge.
The server receives request messages from remote
TcpClientinstances on a base port and returns completion/result messages on base port + 1. Each inbound request is translated into a local memory transaction executed through thisMasterinterface to the attached downstream slave path.Operational behavior:
Request messages carry transaction ID, address, size, type, and optional write data.
Transactions are executed synchronously in the server worker thread.
Responses include returned read data (when applicable) and a status/result string.
The server must bind both bridge ports successfully; binding failures typically indicate address/port conflicts.
Public Functions
-
TcpServer(std::string addr, uint16_t port)
[header] [impl] Constructs a TCP memory bridge server.
Creator.
addrmay be a hostname, IP address, or"*"to bind on all interfaces. The bridge uses two consecutive TCP ports starting atport; for example,port=8000uses ports8000and8001.This constructor is a low-level C++ allocation path. Prefer
create()when shared ownership or Python exposure is required.- Parameters:
addr – Local bind address.
port – Base TCP port number.
Public Static Functions
-
static std::shared_ptr<rogue::interfaces::memory::TcpServer> create(std::string addr, uint16_t port)
[header] [impl] Creates a TCP memory bridge server.
Class creation.
Parameter semantics are identical to the constructor; see
TcpServer()for address and port behavior details.Exposed as
rogue.interfaces.memory.TcpServer()in Python.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_ptrownership compatible with Rogue pointer typedefs.Company : SLAC National Accelerator Laboratory
Description: Memory Server Network Bridge
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:
addr – Local bind address.
port – Base TCP port number.
- Returns:
Shared pointer to the created server.