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

#include <MqttClient.h>

Public Member Functions

 MqttClientConnectionConfig (const Crt::String &endpoint, uint16_t port, const Crt::Io::SocketOptions &socketOptions, Crt::Io::TlsContext &&tlsContext)
 
 MqttClientConnectionConfig (const Crt::String &endpoint, uint16_t port, const Crt::Io::SocketOptions &socketOptions, Crt::Io::TlsContext &&tlsContext, Crt::Mqtt::OnWebSocketHandshakeIntercept &&interceptor, const Crt::Optional< Crt::Http::HttpClientConnectionProxyOptions > &proxyOptions)
 
 operator bool () const noexcept
 
int LastError () const noexcept
 

Static Public Member Functions

static MqttClientConnectionConfig CreateInvalid (int lastError) noexcept
 

Friends

class MqttClient
 
class MqttClientConnectionConfigBuilder
 

Detailed Description

Represents a unique configuration for connecting to a single endpoint. You can use a single instance of this class PER endpoint you want to connect to. This object must live through the lifetime of your connection.

Constructor & Destructor Documentation

◆ MqttClientConnectionConfig() [1/2]

Aws::Iot::MqttClientConnectionConfig::MqttClientConnectionConfig ( const Crt::String endpoint,
uint16_t  port,
const Crt::Io::SocketOptions socketOptions,
Crt::Io::TlsContext &&  tlsContext 
)

Creates a client configuration for use with making new AWS Iot specific MQTT Connections with MTLS.

◆ MqttClientConnectionConfig() [2/2]

Aws::Iot::MqttClientConnectionConfig::MqttClientConnectionConfig ( const Crt::String endpoint,
uint16_t  port,
const Crt::Io::SocketOptions socketOptions,
Crt::Io::TlsContext &&  tlsContext,
Crt::Mqtt::OnWebSocketHandshakeIntercept &&  interceptor,
const Crt::Optional< Crt::Http::HttpClientConnectionProxyOptions > &  proxyOptions 
)

Creates a client configuration for use with making new AWS Iot specific MQTT Connections with web sockets. interceptor: a callback invoked during web socket handshake giving you the opportunity to mutate the request for authorization/signing purposes. If not specified, it's assumed you don't need to sign the request. proxyOptions: optional, if you want to use a proxy with websockets, specify the configuration options here.

If proxy options are used, the tlsContext is applied to the connection to the remote endpoint, NOT the proxy. To make a tls connection to the proxy itself, you'll want to specify tls options in proxyOptions.

Member Function Documentation

◆ CreateInvalid()

MqttClientConnectionConfig Aws::Iot::MqttClientConnectionConfig::CreateInvalid ( int  lastError)
staticnoexcept

◆ LastError()

int Aws::Iot::MqttClientConnectionConfig::LastError ( ) const
inlinenoexcept
Returns
the value of the last aws error encountered by operations on this instance.

◆ operator bool()

Aws::Iot::MqttClientConnectionConfig::operator bool ( ) const
inlineexplicitnoexcept
Returns
true if the instance is in a valid state, false otherwise.

Friends And Related Function Documentation

◆ MqttClient

friend class MqttClient
friend

◆ MqttClientConnectionConfigBuilder

friend class MqttClientConnectionConfigBuilder
friend

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