Package software.amazon.awssdk.crt.io
Class HostResolver
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.io.HostResolver
- All Implemented Interfaces:
AutoCloseable
Java wrapper around the native CRT host resolver, responsible for performing async dns lookups
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Closes the static default host resolver, if it exists.static void
setStaticDefaultMaxEntries
(int maxEntries) Sets the max number of cached host entries for the static default resolver, if it's ever created/used.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
HostResolver
- Parameters:
elg
- event loop group to pass to the host resolver. Not currently used but still mandatory.- Throws:
CrtRuntimeException
-
HostResolver
- Parameters:
elg
- event loop group to pass to the host resolver. Not currently used but still mandatory.maxEntries
- maximum size of the name to address mapping cache- Throws:
CrtRuntimeException
-
-
Method Details
-
setStaticDefaultMaxEntries
public static void setStaticDefaultMaxEntries(int maxEntries) Sets the max number of cached host entries for the static default resolver, if it's ever created/used. Has no effect if the static default host resolver has already been created.- Parameters:
maxEntries
- maximum number of host entries cached
-
closeStaticDefault
public static void closeStaticDefault()Closes the static default host resolver, if it exists. Primarily intended for tests that use the static default resolver, before they call waitForNoResources().
-