TcpServer

TcpServer objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::interfaces::memory::TcpServer> rogue::interfaces::memory::TcpServerPtr

Shared pointer alias for TcpServer.

The class description is shown below:

class TcpServer : public rogue::interfaces::memory::Master

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)

Constructs a TCP memory bridge server.

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()

Destroys the TCP server and releases transport resources.

void close()

Closes bridge connections.

Deprecated; use stop().

virtual void stop()

Stops the bridge interface and worker thread.

Public Static Functions

static std::shared_ptr<rogue::interfaces::memory::TcpServer> create(std::string addr, uint16_t port)

Creates a TCP memory bridge server.

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.

Parameters:
  • addr – Local bind address.

  • port – Base TCP port number.

Returns:

Shared pointer to the created server.

static void setup_python()

Registers this type with Python bindings.