aboutsummaryrefslogtreecommitdiff
path: root/src/core/aio.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-10-31 18:47:07 -0700
committerGarrett D'Amore <garrett@damore.org>2020-10-31 23:10:12 -0700
commit452ecf5ae83adc9ae77518746f4f81171c42248c (patch)
treed81730eef3c19775abf0715831dc18e3f9885d21 /src/core/aio.h
parent587bc765ee69acfabf3bc8b88a70806c07b61f87 (diff)
downloadnng-452ecf5ae83adc9ae77518746f4f81171c42248c.tar.gz
nng-452ecf5ae83adc9ae77518746f4f81171c42248c.tar.bz2
nng-452ecf5ae83adc9ae77518746f4f81171c42248c.zip
fixes #1311 reduce wasted use for nni_aio
fixes #1317 IPv6 listener get port is incorrect fixes #1319 Want symbolic service names This is phase 1 of reducing the memory foot-print of aios, and also of pipes. This removes the largest consumer the socket address information, from the aio, which was only used by a few consumers.
Diffstat (limited to 'src/core/aio.h')
-rw-r--r--src/core/aio.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/core/aio.h b/src/core/aio.h
index c2776bc0..2f699245 100644
--- a/src/core/aio.h
+++ b/src/core/aio.h
@@ -155,12 +155,9 @@ extern void nni_aio_get_iov(nni_aio *, unsigned *, nni_iov **);
extern void nni_aio_normalize_timeout(nni_aio *, nng_duration);
extern void nni_aio_bump_count(nni_aio *, size_t);
-extern void nni_aio_set_sockaddr(nni_aio *aio, const nng_sockaddr *);
-extern void nni_aio_get_sockaddr(nni_aio *aio, nng_sockaddr *);
-
// nni_aio_schedule indicates that the AIO has begun, and is scheduled for
-// asychronous completion. This also starts the expiration timer. Note that
-// prior to this, the aio is uncancellable. If the operation has a zero
+// asynchronous completion. This also starts the expiration timer. Note that
+// prior to this, the aio cannot be canceled. If the operation has a zero
// timeout (NNG_FLAG_NONBLOCK) then NNG_ETIMEDOUT is returned. If the
// operation has already been canceled, or should not be run, then an error
// is returned. (In that case the caller should probably either return an
@@ -198,7 +195,7 @@ struct nng_aio {
// User scratch data. Consumers may store values here, which
// must be preserved by providers and the framework.
- void *a_user_data[4];
+ void *a_user_data[2];
// Operation inputs & outputs. Up to 4 inputs and 4 outputs may be
// specified. The semantics of these will vary, and depend on the
@@ -210,13 +207,7 @@ struct nng_aio {
nni_aio_cancelfn a_cancel_fn;
void * a_cancel_arg;
nni_list_node a_prov_node; // Linkage on provider list.
- void * a_prov_extra[4]; // Extra data used by provider
-
- // Socket address. This turns out to be very useful, as we wind up
- // needing socket addresses for numerous connection related routines.
- // It would be cleaner to not have this and avoid burning the space,
- // but having this hear dramatically simplifies lots of code.
- nng_sockaddr a_sockaddr;
+ void * a_prov_extra[2]; // Extra data used by provider
// Expire node.
nni_list_node a_expire_node;