AWS IoT Device SDK C++ v2 1.44.2
AWS IoT Device SDK C++ v2
Loading...
Searching...
No Matches
Aws::Iot::MqttClientConnectionConfig Class Referencefinal

#include <MqttClient.h>

Public Member Functions

 MqttClientConnectionConfig (const Crt::String &endpoint, uint32_t port, const Crt::Io::SocketOptions &socketOptions, Crt::Io::TlsContext &&tlsContext, bool enableMetrics=true)
 MqttClientConnectionConfig (const Crt::String &endpoint, uint32_t port, const Crt::Io::SocketOptions &socketOptions, Crt::Io::TlsContext &&tlsContext, Crt::Mqtt::OnWebSocketHandshakeIntercept &&interceptor, const Crt::Optional< Crt::Http::HttpClientConnectionProxyOptions > &proxyOptions, bool enableMetrics=true)
 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 AWS IoT 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,
uint32_t port,
const Crt::Io::SocketOptions & socketOptions,
Crt::Io::TlsContext && tlsContext,
bool enableMetrics = true )

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

Parameters
endpointendpoint to connect to
portport to connect to
socketOptionssocket options to use when establishing the connection
tlsContexttls context that should be used for all connections sourced from this config
enableMetricsWhether to set AWS IoT Metrics in the MQTT CONNECT packet. Default is True.

◆ MqttClientConnectionConfig() [2/2]

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

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.

Parameters
endpointendpoint to connect to
portport to connect to
socketOptionssocket options to use when establishing the connection
tlsContexttls context that should be used for all connections sourced from this config
interceptorwebsocket upgrade handshake transformation function
proxyOptionsproxy configuration options
enableMetricsWhether to set AWS IoT Metrics in the MQTT CONNECT packet. Default is True.

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.

◆ MqttClient

friend class MqttClient
friend

◆ MqttClientConnectionConfigBuilder

friend class MqttClientConnectionConfigBuilder
friend

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