aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Public Member Functions | List of all members
Aws::Crt::Mqtt::MqttClient Class Referencefinal

#include <MqttClient.h>

Public Member Functions

 MqttClient (Io::ClientBootstrap &bootstrap, Allocator *allocator=g_allocator) noexcept
 
 ~MqttClient ()
 
 MqttClient (const MqttClient &)=delete
 
 MqttClient (MqttClient &&) noexcept
 
MqttClientoperator= (const MqttClient &)=delete
 
MqttClientoperator= (MqttClient &&) noexcept
 
 operator bool () const noexcept
 
int LastError () const noexcept
 
std::shared_ptr< MqttConnectionNewConnection (const char *hostName, uint16_t port, const Io::SocketOptions &socketOptions, const Crt::Io::TlsContext &tlsContext, bool useWebsocket=false) noexcept
 
std::shared_ptr< MqttConnectionNewConnection (const char *hostName, uint16_t port, const Io::SocketOptions &socketOptions, bool useWebsocket=false) noexcept
 

Detailed Description

An MQTT client. This is a move-only type. Unless otherwise specified, all function arguments need only to live through the duration of the function call.

Constructor & Destructor Documentation

◆ MqttClient() [1/3]

Aws::Crt::Mqtt::MqttClient::MqttClient ( Io::ClientBootstrap bootstrap,
Allocator allocator = g_allocator 
)
noexcept

Initialize an MqttClient using bootstrap and allocator

◆ ~MqttClient()

Aws::Crt::Mqtt::MqttClient::~MqttClient ( )

◆ MqttClient() [2/3]

Aws::Crt::Mqtt::MqttClient::MqttClient ( const MqttClient )
delete

◆ MqttClient() [3/3]

Aws::Crt::Mqtt::MqttClient::MqttClient ( MqttClient &&  toMove)
noexcept

Member Function Documentation

◆ LastError()

int Aws::Crt::Mqtt::MqttClient::LastError ( ) const
noexcept
Returns
the value of the last aws error encountered by operations on this instance.

◆ NewConnection() [1/2]

std::shared_ptr< MqttConnection > Aws::Crt::Mqtt::MqttClient::NewConnection ( const char *  hostName,
uint16_t  port,
const Io::SocketOptions socketOptions,
bool  useWebsocket = false 
)
noexcept

Create a new connection object over plain text from the client. The client must outlive all of its connection instances.

◆ NewConnection() [2/2]

std::shared_ptr< MqttConnection > Aws::Crt::Mqtt::MqttClient::NewConnection ( const char *  hostName,
uint16_t  port,
const Io::SocketOptions socketOptions,
const Crt::Io::TlsContext tlsContext,
bool  useWebsocket = false 
)
noexcept

Create a new connection object using TLS from the client. The client must outlive all of its connection instances.

◆ operator bool()

Aws::Crt::Mqtt::MqttClient::operator bool ( ) const
noexcept
Returns
true if the instance is in a valid state, false otherwise.

◆ operator=() [1/2]

MqttClient & Aws::Crt::Mqtt::MqttClient::operator= ( const MqttClient )
delete

◆ operator=() [2/2]

MqttClient & Aws::Crt::Mqtt::MqttClient::operator= ( MqttClient &&  toMove)
noexcept

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