Concrete INode implementation for a single remote actor-system endpoint.
More...
#include <node.hpp>
Public Types | |
| using | TSocket = typename TPoller::TSocket |
Public Member Functions | |
| TNode (TPoller &poller, TMessagesFactory &factory, TResolver &resolver, const std::function< TSocket(const TAddress &)> &socketFactory, const THostPort &hostPort) | |
| Constructs a TNode but does not connect immediately. | |
| void | Send (TEnvelope &&envelope) override |
Serializes envelope and appends it to the outbound buffer. | |
| std::span< char > | Acquire (size_t size) override |
Reserves size contiguous bytes in the buffer and returns a span over them. | |
| void | Commit (size_t size) override |
Marks size previously acquired bytes as ready to send. | |
| void | StartConnect () override |
| Initiates an async TCP connection if not already connected or connecting. | |
| void | Drain () override |
Calls StartConnect() then asynchronously writes all buffered bytes to the socket. | |
| THostPort | GetHostPort () const override |
| Returns the remote host:port this node connects to. | |
Concrete INode implementation for a single remote actor-system endpoint.
Maintains a persistent TCP connection to hostPort, reconnecting with a 1 s back-off on failure. Outbound messages are accumulated in a vector buffer and flushed by Drain() once the connection is established.
| TPoller | Poller type (e.g. TDefaultPoller); determines the socket type. |
|
inline |
Constructs a TNode but does not connect immediately.
Call StartConnect() or Drain() to initiate the connection.
| poller | Poller used for async I/O and sleep. |
| factory | Factory for serializing messages to their Far (wire) form. |
| resolver | DNS resolver for translating hostPort.Host to an IP. |
| socketFactory | Callable that creates a connected socket given a resolved TAddress. |
| hostPort | Remote host and port to connect to. |
|
inlineoverridevirtual |
Reserves size contiguous bytes in the buffer and returns a span over them.
Implements NNet::NActors::IOutputStream.
|
inlineoverridevirtual |
Marks size previously acquired bytes as ready to send.
Implements NNet::NActors::IOutputStream.
|
inlineoverridevirtual |
Calls StartConnect() then asynchronously writes all buffered bytes to the socket.
Implements NNet::NActors::INode.
|
inlineoverridevirtual |
Returns the remote host:port this node connects to.
Implements NNet::NActors::INode.
|
inlineoverridevirtual |
Serializes envelope and appends it to the outbound buffer.
Implements NNet::NActors::INode.
|
inlineoverridevirtual |
Initiates an async TCP connection if not already connected or connecting.
Implements NNet::NActors::INode.