The establishing side of a reliable, datagram-oriented transport.
A connector opens outbound connections to a remote peer, performing any necessary protocol-level configuration and establishment, then provides a handle which is used to read to or write from that socket.
The ReliableConnector interface does not specify any addressing or ports, as those details are protocol-dependent. A concrete ReliableConnector instance should be constructed with and internally store any such state if required.
If a ReliableConnector is destructed, it must resolve any pending ConnectFuture objects with a FAILED_PRECONDITION.
Public Types | |
| using | ConnectFuture = async2::ValueFuture< Result< ReliableSocket > > |
Public Member Functions | |
| virtual ConnectFuture | Connect ()=0 |
Static Protected Member Functions | |
| static ReliableSocket | WrapSocket (ReliableSocketImpl &impl) |
Creates a ReliableSocket handle from an implementation. | |
| using pw::transport::ReliableConnector::ConnectFuture = async2::ValueFuture<Result<ReliableSocket> > |
The future returned by Connect, resolving to a ReliableSocket handle on success.
|
pure virtual |
Opens a connection to the peer, returning it once established.
It is up to the implementation to decide whether concurrent connections to the peer are allowed. If not supported, subsequent calls to Connect when a connection is active should return ALREADY_EXISTS. It must always be possible to call Connect again when no connections are active and the transport is still alive.