AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
Public Member Functions | Friends | List of all members
Aws::Eventstreamrpc::ClientConnection Class Referencefinal

#include <EventStreamClient.h>

Public Member Functions

 ClientConnection (Crt::Allocator *allocator=Crt::g_allocator) noexcept
 
 ~ClientConnection () noexcept
 
 ClientConnection (const ClientConnection &) noexcept=delete
 
ClientConnectionoperator= (const ClientConnection &) noexcept=delete
 
 ClientConnection (ClientConnection &&) noexcept
 
ClientConnectionoperator= (ClientConnection &&) noexcept
 
std::future< RpcErrorConnect (const ConnectionConfig &connectionOptions, ConnectionLifecycleHandler *connectionLifecycleHandler, Crt::Io::ClientBootstrap &clientBootstrap) noexcept
 
std::future< RpcErrorSendPing (const Crt::List< EventStreamHeader > &headers, const Crt::Optional< Crt::ByteBuf > &payload, OnMessageFlushCallback onMessageFlushCallback) noexcept
 
std::future< RpcErrorSendPingResponse (const Crt::List< EventStreamHeader > &headers, const Crt::Optional< Crt::ByteBuf > &payload, OnMessageFlushCallback onMessageFlushCallback) noexcept
 
ClientContinuation NewStream (ClientContinuationHandler &clientContinuationHandler) noexcept
 
void Close () noexcept
 
bool IsOpen () const noexcept
 
 operator bool () const noexcept
 

Friends

class ClientContinuation
 
std::future< RpcErrorClientOperation::Close (OnMessageFlushCallback onMessageFlushCallback) noexcept
 

Detailed Description

Class representing a connection to an RPC server.

Constructor & Destructor Documentation

◆ ClientConnection() [1/3]

Aws::Eventstreamrpc::ClientConnection::ClientConnection ( Crt::Allocator allocator = Crt::g_allocator)
noexcept

◆ ~ClientConnection()

Aws::Eventstreamrpc::ClientConnection::~ClientConnection ( )
noexcept

◆ ClientConnection() [2/3]

Aws::Eventstreamrpc::ClientConnection::ClientConnection ( const ClientConnection )
deletenoexcept

◆ ClientConnection() [3/3]

Aws::Eventstreamrpc::ClientConnection::ClientConnection ( ClientConnection &&  rhs)
noexcept

Member Function Documentation

◆ Close()

void Aws::Eventstreamrpc::ClientConnection::Close ( )
noexcept

Close the connection.

◆ Connect()

std::future< RpcError > Aws::Eventstreamrpc::ClientConnection::Connect ( const ConnectionConfig connectionOptions,
ConnectionLifecycleHandler connectionLifecycleHandler,
Crt::Io::ClientBootstrap clientBootstrap 
)
noexcept

Initiates a new outgoing event-stream-rpc connection.

Parameters
connectionOptionsConnection options.
connectionLifecycleHandlerHandler to process connection lifecycle events.
clientBootstrapClientBootstrap object to run the connection on.
Returns
Future that will be resolved when connection either succeeds or fails.

◆ IsOpen()

bool Aws::Eventstreamrpc::ClientConnection::IsOpen ( ) const
inlinenoexcept

Check if the connection is open.

Returns
True if the connection is open, false otherwise.

◆ NewStream()

ClientContinuation Aws::Eventstreamrpc::ClientConnection::NewStream ( ClientContinuationHandler clientContinuationHandler)
noexcept

Create a new stream.

Note
Activate() must be called on the stream for it to actually initiate the new stream.
Parameters
clientContinuationHandlerHandler to process continuation events.
Returns
A newly created continuation.

◆ operator bool()

Aws::Eventstreamrpc::ClientConnection::operator bool ( ) const
inlinenoexcept
Returns
true if the connection is open, false otherwise.

◆ operator=() [1/2]

ClientConnection & Aws::Eventstreamrpc::ClientConnection::operator= ( ClientConnection &&  rhs)
noexcept

◆ operator=() [2/2]

ClientConnection& Aws::Eventstreamrpc::ClientConnection::operator= ( const ClientConnection )
deletenoexcept

◆ SendPing()

std::future< RpcError > Aws::Eventstreamrpc::ClientConnection::SendPing ( const Crt::List< EventStreamHeader > &  headers,
const Crt::Optional< Crt::ByteBuf > &  payload,
OnMessageFlushCallback  onMessageFlushCallback 
)
noexcept

◆ SendPingResponse()

std::future< RpcError > Aws::Eventstreamrpc::ClientConnection::SendPingResponse ( const Crt::List< EventStreamHeader > &  headers,
const Crt::Optional< Crt::ByteBuf > &  payload,
OnMessageFlushCallback  onMessageFlushCallback 
)
noexcept

Friends And Related Function Documentation

◆ ClientContinuation

friend class ClientContinuation
friend

◆ ClientOperation::Close

std::future<RpcError> ClientOperation::Close ( OnMessageFlushCallback  onMessageFlushCallback)
friend

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