AWS IoT Device SDK C++ v2: Aws::Crt::Io::DefaultHostResolver 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::DefaultHostResolver Class Referencefinal

`#include <HostResolver.h>`

Inheritance diagram for Aws::Crt::Io::DefaultHostResolver:

## Public Member Functions
| DefaultHostResolver (EventLoopGroup &elGroup, size_t maxHosts, size_t maxTTL, Allocator *allocator=g_allocator) noexcept
| ~DefaultHostResolver ()
| DefaultHostResolver (const DefaultHostResolver &)=delete
DefaultHostResolver & | operator= (const DefaultHostResolver &)=delete
| DefaultHostResolver (DefaultHostResolver &&)=delete
DefaultHostResolver & | operator= (DefaultHostResolver &&)=delete
| operator bool () const noexcept
int | LastError () const noexcept
bool | ResolveHost (const String &host, const OnHostResolved &onResolved) noexcept override
Public Member Functions inherited from Aws::Crt::Io::HostResolver
virtual | ~HostResolver ()

## Detailed Description

A wrapper around the CRT default host resolution system that uses getaddrinfo() farmed off to separate threads in order to resolve names.

## Constructor & Destructor Documentation

## ◆ DefaultHostResolver() [1/3]

Aws::Crt::Io::DefaultHostResolver::DefaultHostResolver | ( | EventLoopGroup & | elGroup,
|  | size_t | maxHosts,
|  | size_t | maxTTL,
|  | Allocator * | allocator = `g_allocator`
| ) |  |
| noexcept

Resolves DNS addresses.

Parameters

  maxHosts | the number of unique hosts to maintain in the cache.
  maxTTL | how long to keep an address in the cache before evicting it.

## ◆ ~DefaultHostResolver()

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

## ◆ DefaultHostResolver() [2/3]

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

## ◆ DefaultHostResolver() [3/3]

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

## Member Function Documentation

## ◆ LastError()

int Aws::Crt::Io::DefaultHostResolver::LastError | ( |  | ) | const
| inlinenoexcept

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

## ◆ operator bool()

Aws::Crt::Io::DefaultHostResolver::operator bool | ( |  | ) | const
| inlinenoexcept

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

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

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

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

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

## ◆ ResolveHost()

bool Aws::Crt::Io::DefaultHostResolver::ResolveHost | ( | const String & | host,
|  | const OnHostResolved & | onResolved
| ) |  |
| overridevirtualnoexcept

Kicks off an asynchronous resolution of host. onResolved will be invoked upon completion of the resolution.

Returns
  False, the resolution was not attempted. True, onResolved will be called with the result.

Implements Aws::Crt::Io::HostResolver.

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

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