AWS IoT Device SDK C++ v2  1.32.6
AWS IoT Device SDK C++ v2
Public Member Functions | List of all members
Aws::Eventstreamrpc::ConnectionLifecycleHandler Class Reference

#include <EventStreamClient.h>

Public Member Functions

virtual ~ConnectionLifecycleHandler () noexcept=default
 
virtual void OnConnectCallback ()
 
virtual void OnDisconnectCallback (RpcError status)
 
virtual bool OnErrorCallback (RpcError status)
 
virtual void OnPingCallback (const Crt::List< EventStreamHeader > &headers, const Crt::Optional< Crt::ByteBuf > &payload)
 

Detailed Description

Handler interface for connection lifecycle events.

Constructor & Destructor Documentation

◆ ~ConnectionLifecycleHandler()

virtual Aws::Eventstreamrpc::ConnectionLifecycleHandler::~ConnectionLifecycleHandler ( )
virtualdefaultnoexcept

Member Function Documentation

◆ OnConnectCallback()

void Aws::Eventstreamrpc::ConnectionLifecycleHandler::OnConnectCallback ( )
virtual

This callback is only invoked upon receiving a CONNECT_ACK with the CONNECTION_ACCEPTED flag set by the server. Therefore, once this callback is invoked, the ClientConnection is ready to be used for sending messages.

◆ OnDisconnectCallback()

void Aws::Eventstreamrpc::ConnectionLifecycleHandler::OnDisconnectCallback ( RpcError  status)
virtual

Invoked upon connection shutdown.

Parameters
statusThe status upon disconnection. It can be treated as a bool with true implying a successful disconnection.

◆ OnErrorCallback()

bool Aws::Eventstreamrpc::ConnectionLifecycleHandler::OnErrorCallback ( RpcError  status)
virtual

Invoked upon receiving an error. Use the return value to determine whether or not to force the connection to close. Keep in mind that once closed, the ClientConnection can no longer send messages.

Parameters
statusThe status upon disconnection. It can be treated as a bool with true implying a successful disconnection.

◆ OnPingCallback()

void Aws::Eventstreamrpc::ConnectionLifecycleHandler::OnPingCallback ( const Crt::List< EventStreamHeader > &  headers,
const Crt::Optional< Crt::ByteBuf > &  payload 
)
virtual

Invoked upon receiving a ping from the server. The headers and payload refer to what is contained in the ping message.


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