diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-28 23:29:35 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-28 23:29:35 -0800 |
| commit | d574649899a29ce7eb96485c0a4c606f14f87011 (patch) | |
| tree | 0d6282c98fc458a4c24cc0b9f0f442bb2b958da3 /src/core/platform.h | |
| parent | 945dbef5e8eb060654aec33851937f1e3325913b (diff) | |
| download | nng-d574649899a29ce7eb96485c0a4c606f14f87011.tar.gz nng-d574649899a29ce7eb96485c0a4c606f14f87011.tar.bz2 nng-d574649899a29ce7eb96485c0a4c606f14f87011.zip | |
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.
Diffstat (limited to 'src/core/platform.h')
| -rw-r--r-- | src/core/platform.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 |
