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 TcpClient instances 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 this Master interface 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.

addr may be a hostname, IP address, or "*" to bind on all interfaces. The bridge uses two consecutive TCP ports starting at port; for example, port=8000 uses ports 8000 and 8001.

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.

~TcpServer()
[header] [impl]

Destroys the TCP server and releases transport resources.

Destructor.

void close()
[header] [impl]

Closes bridge connections.

Deprecated; use stop().

virtual void stop()
[header] [impl]

Stops the bridge interface and worker thread.

void start()
[header] [impl]

Managed-lifecycle startup hook.

The server binds and starts its worker thread in the constructor, so the managed startup hook is a no-op. It exists so TcpServer can participate uniformly in PyRogue managed interface lifecycle handling.

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_ptr ownership 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.

static void setup_python()
[header] [impl]

Registers this type with Python bindings.