TcpClient

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

typedef std::shared_ptr<rogue::interfaces::memory::TcpClient> rogue::interfaces::memory::TcpClientPtr

Shared pointer alias for TcpClient.

The class description is shown below:

class TcpClient : public rogue::interfaces::memory::Slave

Memory TCP bridge client.

Bridges a local memory transaction source to a remote TcpServer.

The client accepts transactions through its Slave interface and sends them over a two-socket request/response transport (base port and base port + 1). Non-posted transactions are tracked by transaction ID until a response is received by the background thread.

Operational behavior:

  • Write/Post transactions include payload bytes in the outbound message.

  • Read/Verify transactions send metadata and receive payload bytes in the response.

  • Posted writes are completed locally after send (no response wait).

  • If the remote side is unavailable or send path is backpressured, sends may fail and in-flight transactions can time out at higher layers.

Public Functions

TcpClient(std::string addr, uint16_t port)

Constructs a TCP memory bridge client.

The address is the remote TcpServer host (IP or hostname). 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 – Remote server address.

  • port – Base TCP port number.

~TcpClient()

Destroys the TCP client and releases transport resources.

void close()

Closes bridge connections.

Deprecated; use stop().

virtual void stop()

Stops the bridge interface and worker thread.

virtual void doTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> tran)

Processes a transaction received from the upstream master.

Parameters:

tranTransaction to forward to the remote server.

Public Static Functions

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

Creates a TCP memory bridge client.

Parameter semantics are identical to the constructor; see TcpClient() for address and port behavior details. Exposed as rogue.interfaces.memory.TcpClient() 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 – Remote server address.

  • port – Base TCP port number.

Returns:

Shared pointer to the created client.

static void setup_python()

Registers this type with Python bindings.