From d574649899a29ce7eb96485c0a4c606f14f87011 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 28 Dec 2024 23:29:35 -0800 Subject: resolver: use explicit resolver item provided by caller This avoids the need to perform multiple allocations for dialing, eliminating additional potential failures. Cancellation is also made simpler and more perfectly robust. --- src/core/platform.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/platform.h') diff --git a/src/core/platform.h b/src/core/platform.h index 8b7aabbc..47f90467 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -347,6 +347,17 @@ extern int nni_tcp_listener_set( extern int nni_tcp_listener_get( nni_tcp_listener *, const char *, void *, size_t *, nni_type); +typedef struct nni_resolv_item { + int ri_family; + bool ri_passive; + const char *ri_host; + uint16_t ri_port; + nng_sockaddr *ri_sa; // where result will be written + +} nni_resolv_item; + +extern void nni_resolv(nni_resolv_item *, nni_aio *); + // nni_resolv_ip resolves a DNS host and service name asynchronously. // The family should be one of NNG_AF_INET, NNG_AF_INET6, or NNG_AF_UNSPEC. // The first two constrain the name to those families, while the third will -- cgit v1.2.3-70-g09d2