|
rogue
|
Memory TCP bridge client. More...
#include <TcpClient.h>
Public Member Functions | |
| TcpClient (std::string addr, uint16_t port, bool waitReady=false) | |
| Constructs a TCP memory bridge client. | |
| ~TcpClient () | |
| Destroys the TCP client and releases transport resources. | |
| void | close () |
| Closes bridge connections. | |
| void | stop () |
| Stops the bridge interface and worker thread. | |
| bool | waitReady (double timeout, double period) |
| Wait for the remote TcpServer path to respond to a bridge probe. | |
| void | start () |
| Managed-lifecycle startup hook. | |
| void | doTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > tran) |
| Processes a transaction received from the upstream master. | |
Public Member Functions inherited from rogue::interfaces::memory::Slave | |
| Slave (uint32_t min, uint32_t max) | |
| Constructs a memory slave. | |
| virtual | ~Slave () |
| Destroys the memory slave instance. | |
| void | addTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction) |
| Adds a transaction to the internal tracking map. | |
| std::shared_ptr< rogue::interfaces::memory::Transaction > | getTransaction (uint32_t index) |
| Gets a transaction from the internal tracking map. | |
| uint32_t | min () |
| Returns configured minimum transaction size. | |
| uint32_t | max () |
| Returns configured maximum transaction size. | |
| uint32_t | id () |
| Returns unique slave ID. | |
| void | setName (std::string name) |
| Sets slave name. | |
| std::string | name () |
| Returns slave name. | |
| virtual uint32_t | doSlaveId () |
Services SlaveId request from a master. | |
| virtual std::string | doSlaveName () |
Services SlaveName request from a master. | |
| virtual uint32_t | doMinAccess () |
Services getMinAccess request from an attached master. | |
| virtual uint32_t | doMaxAccess () |
Services getMaxAccess request from an attached master. | |
| virtual uint64_t | doAddress () |
Services getAddress request from an attached master. | |
| void | lshiftPy (boost::python::object p) |
Supports << operator usage from Python. | |
| std::shared_ptr< rogue::interfaces::memory::Master > & | operator<< (std::shared_ptr< rogue::interfaces::memory::Master > &other) |
| Connects this slave to a master via chaining operator. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::memory::Slave > | |
| std::shared_ptr< rogue::interfaces::memory::Slave > | shared_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. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::interfaces::memory::TcpClient > | create (std::string addr, uint16_t port, bool waitReady=false) |
| Creates a TCP memory bridge client. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Static Public Member Functions inherited from rogue::interfaces::memory::Slave | |
| static std::shared_ptr< rogue::interfaces::memory::Slave > | create (uint32_t min, uint32_t max) |
| Creates a memory slave. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
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:
Definition at line 53 of file TcpClient.h.
| rogue::interfaces::memory::TcpClient::TcpClient | ( | std::string | addr, |
| uint16_t | port, | ||
| bool | waitReady = false |
||
| ) |
Constructs a TCP memory bridge client.
Creator.
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. waitReady does not block in the constructor itself; it configures whether _start() should perform readiness probing later.
| addr | Remote server address. |
| port | Base TCP port number. |
| waitReady | If true, record that _start() should block until the bridge request/response path responds to a readiness probe. |
Definition at line 55 of file TcpClient.cpp.
| rogue::interfaces::memory::TcpClient::~TcpClient | ( | ) |
Destroys the TCP client and releases transport resources.
Destructor.
Definition at line 127 of file TcpClient.cpp.
| void rogue::interfaces::memory::TcpClient::close | ( | ) |
|
static |
Creates a TCP memory bridge client.
Class creation.
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.
| addr | Remote server address. |
| port | Base TCP port number. |
| waitReady | If true, configure the instance so _start() waits for bridge readiness before returning. |
Definition at line 49 of file TcpClient.cpp.
|
virtual |
Processes a transaction received from the upstream master.
Post a transaction.
| tran | Transaction to forward to the remote server. |
Reimplemented from rogue::interfaces::memory::Slave.
Definition at line 222 of file TcpClient.cpp.
|
static |
Registers this type with Python bindings.
Definition at line 410 of file TcpClient.cpp.
| void rogue::interfaces::memory::TcpClient::start | ( | ) |
Managed-lifecycle startup hook.
If this instance was constructed with waitReady=true, _start() blocks until the bridge request/response path responds to a readiness probe. Otherwise it is a no-op.
Definition at line 211 of file TcpClient.cpp.
|
virtual |
Stops the bridge interface and worker thread.
Reimplemented from rogue::interfaces::memory::Slave.
Definition at line 136 of file TcpClient.cpp.
| bool rogue::interfaces::memory::TcpClient::waitReady | ( | double | timeout, |
| double | period | ||
| ) |
Wait for the remote TcpServer path to respond to a bridge probe.
This sends a lightweight internal control transaction through the bridge and waits for the remote TcpServer to acknowledge it. It verifies that the request/response path is usable, which is stronger than a local socket-connect state.
| timeout | Maximum wait time in seconds. |
| period | Retry period in seconds. |
true if the probe succeeds before timeout, otherwise false. Definition at line 147 of file TcpClient.cpp.