AWS IoT Device SDK C++ v2  1.34.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:
Aws::Crt::Io::HostResolver

Public Member Functions

 DefaultHostResolver (EventLoopGroup &elGroup, size_t maxHosts, size_t maxTTL, Allocator *allocator=ApiAllocator()) noexcept
 
 DefaultHostResolver (size_t maxHosts, size_t maxTTL, Allocator *allocator=ApiAllocator()) noexcept
 
 ~DefaultHostResolver ()
 
 DefaultHostResolver (const DefaultHostResolver &)=delete
 
DefaultHostResolveroperator= (const DefaultHostResolver &)=delete
 
 DefaultHostResolver (DefaultHostResolver &&)=delete
 
DefaultHostResolveroperator= (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/4]

Aws::Crt::Io::DefaultHostResolver::DefaultHostResolver ( EventLoopGroup elGroup,
size_t  maxHosts,
size_t  maxTTL,
Allocator allocator = ApiAllocator() 
)
noexcept

Resolves DNS addresses.

Parameters
elGroupEventLoopGroup to use.
maxHoststhe number of unique hosts to maintain in the cache.
maxTTLhow long to keep an address in the cache before evicting it.
allocatormemory allocator to use.

◆ DefaultHostResolver() [2/4]

Aws::Crt::Io::DefaultHostResolver::DefaultHostResolver ( size_t  maxHosts,
size_t  maxTTL,
Allocator allocator = ApiAllocator() 
)
noexcept

Resolves DNS addresses using the default EventLoopGroup.

For more information on the default EventLoopGroup see Aws::Crt::ApiHandle::GetOrCreateStaticDefaultEventLoopGroup

Parameters
maxHoststhe number of unique hosts to maintain in the cache.
maxTTLhow long to keep an address in the cache before evicting it.
allocatormemory allocator to use.

◆ ~DefaultHostResolver()

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

◆ DefaultHostResolver() [3/4]

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

◆ DefaultHostResolver() [4/4]

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: