aws-crt-cpp
Public Member Functions | List of all members
Aws::Iot::MqttClientConnectionConfigBuilder Class Referencefinal

#include <MqttClient.h>

Public Member Functions

 MqttClientConnectionConfigBuilder ()
 
 MqttClientConnectionConfigBuilder (const char *certPath, const char *pkeyPath, Crt::Allocator *allocator=Crt::g_allocator) noexcept
 
 MqttClientConnectionConfigBuilder (const Crt::ByteCursor &cert, const Crt::ByteCursor &pkey, Crt::Allocator *allocator=Crt::g_allocator) noexcept
 
 MqttClientConnectionConfigBuilder (const WebsocketConfig &config, Crt::Allocator *allocator=Crt::g_allocator) noexcept
 
MqttClientConnectionConfigBuilderWithEndpoint (const Crt::String &endpoint)
 
MqttClientConnectionConfigBuilderWithEndpoint (Crt::String &&endpoint)
 
MqttClientConnectionConfigBuilderWithPortOverride (uint16_t port) noexcept
 
MqttClientConnectionConfigBuilderWithCertificateAuthority (const char *caPath) noexcept
 
MqttClientConnectionConfigBuilderWithCertificateAuthority (const Crt::ByteCursor &cert) noexcept
 
MqttClientConnectionConfigBuilderWithTcpKeepAlive () noexcept
 
MqttClientConnectionConfigBuilderWithTcpConnectTimeout (uint32_t connectTimeoutMs) noexcept
 
MqttClientConnectionConfigBuilderWithTcpKeepAliveTimeout (uint16_t keepAliveTimeoutSecs) noexcept
 
MqttClientConnectionConfigBuilderWithTcpKeepAliveInterval (uint16_t keepAliveIntervalSecs) noexcept
 
MqttClientConnectionConfigBuilderWithTcpKeepAliveMaxProbes (uint16_t maxProbes) noexcept
 
MqttClientConnectionConfig Build () noexcept
 
 operator bool () const noexcept
 
int LastError () const noexcept
 

Detailed Description

Represents configuration parameters for building a MqttClientConnectionConfig object. You can use a single instance of this class PER MqttClientConnectionConfig you want to generate. If you want to generate a config for a different endpoint or port etc... you need a new instance of this class.

Constructor & Destructor Documentation

◆ MqttClientConnectionConfigBuilder() [1/4]

Aws::Iot::MqttClientConnectionConfigBuilder::MqttClientConnectionConfigBuilder ( )

◆ MqttClientConnectionConfigBuilder() [2/4]

Aws::Iot::MqttClientConnectionConfigBuilder::MqttClientConnectionConfigBuilder ( const char *  certPath,
const char *  pkeyPath,
Crt::Allocator allocator = Crt::g_allocator 
)
noexcept

Sets the builder up for MTLS using certPath and pkeyPath. These are files on disk and must be in the PEM format.

◆ MqttClientConnectionConfigBuilder() [3/4]

Aws::Iot::MqttClientConnectionConfigBuilder::MqttClientConnectionConfigBuilder ( const Crt::ByteCursor cert,
const Crt::ByteCursor pkey,
Crt::Allocator allocator = Crt::g_allocator 
)
noexcept

Sets the builder up for MTLS using cert and pkey. These are in-memory buffers and must be in the PEM format.

◆ MqttClientConnectionConfigBuilder() [4/4]

Aws::Iot::MqttClientConnectionConfigBuilder::MqttClientConnectionConfigBuilder ( const WebsocketConfig config,
Crt::Allocator allocator = Crt::g_allocator 
)
noexcept

Sets the builder up for Websocket connection.

Member Function Documentation

◆ Build()

MqttClientConnectionConfig Aws::Iot::MqttClientConnectionConfigBuilder::Build ( )
noexcept

Builds a client configuration object from the set options.

◆ LastError()

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

◆ operator bool()

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

◆ WithCertificateAuthority() [1/2]

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithCertificateAuthority ( const char *  caPath)
noexcept

Sets the certificate authority for the endpoint you're connecting to. This is a path to a file on disk and must be in PEM format.

◆ WithCertificateAuthority() [2/2]

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithCertificateAuthority ( const Crt::ByteCursor cert)
noexcept

Sets the certificate authority for the endpoint you're connecting to. This is an in-memory buffer and must be in PEM format.

◆ WithEndpoint() [1/2]

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithEndpoint ( const Crt::String endpoint)

Sets endpoint to connect to.

◆ WithEndpoint() [2/2]

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithEndpoint ( Crt::String &&  endpoint)

Sets endpoint to connect to.

◆ WithPortOverride()

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithPortOverride ( uint16_t  port)
noexcept

Overrides the default port. By default, if ALPN is supported, 443 will be used. Otherwise 8883 will be used. If you specify 443 and ALPN is not supported, we will still attempt to connect over 443 without ALPN.

◆ WithTcpConnectTimeout()

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithTcpConnectTimeout ( uint32_t  connectTimeoutMs)
noexcept

TCP option: Sets the connect timeout. Defaults to 3 seconds.

◆ WithTcpKeepAlive()

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithTcpKeepAlive ( )
noexcept

TCP option: Enables TCP keep alive. Defaults to off.

◆ WithTcpKeepAliveInterval()

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithTcpKeepAliveInterval ( uint16_t  keepAliveIntervalSecs)
noexcept

TCP option: Sets the frequency of sending keep alive probes in seconds once the keep alive timeout expires. Defaults to kernel defaults.

◆ WithTcpKeepAliveMaxProbes()

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithTcpKeepAliveMaxProbes ( uint16_t  maxProbes)
noexcept

TCP option: Sets the amount of keep alive probes allowed to fail before the connection is terminated. Defaults to kernel defaults.

◆ WithTcpKeepAliveTimeout()

MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithTcpKeepAliveTimeout ( uint16_t  keepAliveTimeoutSecs)
noexcept

TCP option: Sets time before keep alive probes are sent. Defaults to kernel defaults


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