AWS IoT Device SDK C++ v2: Aws::Crt::Io::ClientBootstrap Class Reference

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

Public Member Functions | List of all members
Aws::Crt::Io::ClientBootstrap Class Referencefinal

`#include <Bootstrap.h>`

## Public Member Functions
| ClientBootstrap (EventLoopGroup &elGroup, HostResolver &resolver, Allocator *allocator=g_allocator) noexcept
| ~ClientBootstrap ()
| ClientBootstrap (const ClientBootstrap &)=delete
ClientBootstrap & | operator= (const ClientBootstrap &)=delete
| ClientBootstrap (ClientBootstrap &&)=delete
ClientBootstrap & | operator= (ClientBootstrap &&)=delete
| operator bool () const noexcept
int | LastError () const noexcept
void | SetShutdownCompleteCallback (OnClientBootstrapShutdownComplete callback)
void | EnableBlockingShutdown () noexcept

## Detailed Description

A ClientBootstrap handles creation and setup of socket connections to specific endpoints.

Note that ClientBootstrap may not clean up all its behind-the-scenes resources immediately upon destruction. If you need to know when behind-the-scenes shutdown is complete, use SetShutdownCompleteCallback() or EnableBlockingShutdown() (only safe on main thread).

## Constructor & Destructor Documentation

## ◆ ClientBootstrap() [1/3]

Aws::Crt::Io::ClientBootstrap::ClientBootstrap | ( | EventLoopGroup & | elGroup,
|  | HostResolver & | resolver,
|  | Allocator * | allocator = `g_allocator`
| ) |  |
| noexcept

Parameters

  elGroup | EventLoopGroup to use.
  resolver | DNS host resolver to use.

## ◆ ~ClientBootstrap()

Aws::Crt::Io::ClientBootstrap::~ClientBootstrap | ( |  | ) |

## ◆ ClientBootstrap() [2/3]

Aws::Crt::Io::ClientBootstrap::ClientBootstrap | ( | const ClientBootstrap & |  | ) |
| delete

## ◆ ClientBootstrap() [3/3]

Aws::Crt::Io::ClientBootstrap::ClientBootstrap | ( | ClientBootstrap && |  | ) |
| delete

## Member Function Documentation

## ◆ EnableBlockingShutdown()

void Aws::Crt::Io::ClientBootstrap::EnableBlockingShutdown | ( |  | ) |
| noexcept

Force the ClientBootstrap's destructor to block until all behind-the-scenes resources finish shutting down.

This isn't necessary during the normal flow of an application, but it is useful for scenarios, such as tests, that need deterministic shutdown ordering. Be aware, if you use this anywhere other than the main thread, YOU WILL MOST LIKELY CAUSE A DEADLOCK.

Use SetShutdownCompleteCallback() for a thread-safe way to know when shutdown is complete.

## ◆ LastError()

int Aws::Crt::Io::ClientBootstrap::LastError | ( |  | ) | const
| noexcept

Returns
  the value of the last aws error encountered by operations on this instance.

## ◆ operator bool()

Aws::Crt::Io::ClientBootstrap::operator bool | ( |  | ) | const
| noexcept

Returns
  true if the instance is in a valid state, false otherwise.

## ◆ operator=() [1/2]

ClientBootstrap & Aws::Crt::Io::ClientBootstrap::operator= | ( | ClientBootstrap && |  | ) |
| delete

## ◆ operator=() [2/2]

ClientBootstrap & Aws::Crt::Io::ClientBootstrap::operator= | ( | const ClientBootstrap & |  | ) |
| delete

## ◆ SetShutdownCompleteCallback()

void Aws::Crt::Io::ClientBootstrap::SetShutdownCompleteCallback | ( | OnClientBootstrapShutdownComplete | callback | ) |

Set function to invoke when ClientBootstrap's behind-the-scenes resources finish shutting down. This function may be invoked on any thread. Shutdown begins when the ClientBootstrap's destructor runs.

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

- crt/aws-crt-cpp/include/aws/crt/io/Bootstrap.h
- crt/aws-crt-cpp/source/io/Bootstrap.cpp