A thread-safe monitor for tracking outgoing remote messages and detecting timeouts.
More...
A thread-safe monitor for tracking outgoing remote messages and detecting timeouts.
The TransportMonitor implements the reliability layer for remote delegate invocations. It tracks "in-flight" messages by their sequence number and timestamps them upon sending.
Key Responsibilities:
- Timeout Detection: Identifies messages that have not been acknowledged within the configured
TRANSPORT_TIMEOUT duration.
- Status Reporting: Invokes the
SendStatusCb delegate with Status::SUCCESS (upon ACK) or Status::TIMEOUT (upon expiration) to notify the application.
- Thread Safety: Internal state is protected by a recursive mutex, allowing safe access from multiple threads (e.g., sending thread vs. ACK receiving thread).
Usage Note: This class relies on a cooperative polling model. The Process() method must be called periodically (typically by a background timer or the network thread loop) to scan for and handle expired messages.