Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. pw_rpc2
  5. Client
  6. pw::rpc2::ClientFuture Class Reference
Loading...
Searching...
No Matches
pw::rpc2::ClientFuture Class Reference

Overview

Future that resolves to a connected Client. Returned by Client::Connect().

Public Types

using value_type = RpcResult< Client >
 

Public Member Functions

constexpr ClientFuture ()=default
 Constructs an empty future, which is neither pendable nor complete.
 
 ClientFuture (const ClientFuture &)=delete
 
ClientFuture & operator= (const ClientFuture &)=delete
 
 ClientFuture (ClientFuture &&other) noexcept
 
ClientFuture & operator= (ClientFuture &&other) noexcept
 
bool is_pendable () const
 
bool is_complete () const
 
async2::Poll< RpcResult< Client > > Pend (async2::Context &cx)
 

Friends

class Client
 

Member Function Documentation

◆ Pend()

async2::Poll< RpcResult< Client > > pw::rpc2::ClientFuture::Pend ( async2::Context &  cx)

Connects (if created from a connector), performs the handshake, and starts the client's connection task.

Returns
  • kOk with the connected Client.
  • kDisconnected if the connector's Connect() failed (the transport's error is logged) or the connection closed during the handshake.
  • kProtocolError if the peer sent an invalid or unexpected handshake packet, or negotiated an incompatible protocol version. The reason is logged.
  • kResourceExhausted if the connection task could not be allocated.

The documentation for this class was generated from the following file: