AWS IoT Device SDK C++ v2: Aws::Iot::MqttClientConnectionConfig Class Reference

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

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 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,
|  | 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.

Parameters

  endpoint | endpoint to connect to
  port | port to connect to
  socketOptions | socket options to use when establishing the connection
  tlsContext | tls context that should be used for all connections sourced from this config

## ◆ 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.

Parameters

  endpoint | endpoint to connect to
  port | port to connect to
  socketOptions | socket options to use when establishing the connection
  tlsContext | tls context that should be used for all connections sourced from this config
  interceptor | websocket upgrade handshake transformation function
  proxyOptions | proxy configuration options

## 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:

- crt/aws-crt-cpp/include/aws/iot/MqttClient.h
- crt/aws-crt-cpp/source/iot/MqttClient.cpp