aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-08 20:38:38 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-11 07:01:32 -0800
commita7a3046f7cca833e895d58976843663d1df5caba (patch)
treed6ebcb06559facec558aae5b7b7a81c40e2590d4 /src/core
parent2ade67cf0bad8596838762d085664d87e91093ba (diff)
downloadnng-a7a3046f7cca833e895d58976843663d1df5caba.tar.gz
nng-a7a3046f7cca833e895d58976843663d1df5caba.tar.bz2
nng-a7a3046f7cca833e895d58976843663d1df5caba.zip
endpoints: add transport ep stop functions
This should allow us to stop the endpoints early, without freeing them. This ensures that pipe creation has ended before we start tearing down pipes.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dialer.c5
-rw-r--r--src/core/listener.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/core/dialer.c b/src/core/dialer.c
index 388d9981..6224ce9b 100644
--- a/src/core/dialer.c
+++ b/src/core/dialer.c
@@ -541,9 +541,12 @@ nni_dialer_start(nni_dialer *d, unsigned flags)
void
nni_dialer_stop(nni_dialer *d)
{
+ d->d_ops.d_close(d->d_data);
nni_aio_stop(&d->d_tmo_aio);
nni_aio_stop(&d->d_con_aio);
- d->d_ops.d_close(d->d_data);
+ if (d->d_ops.d_stop) {
+ d->d_ops.d_stop(d->d_data);
+ }
}
nni_sock *
diff --git a/src/core/listener.c b/src/core/listener.c
index 3dc2a0fa..1eeaa3cd 100644
--- a/src/core/listener.c
+++ b/src/core/listener.c
@@ -524,9 +524,12 @@ nni_listener_start(nni_listener *l, int flags)
void
nni_listener_stop(nni_listener *l)
{
+ l->l_ops.l_close(l->l_data);
nni_aio_stop(&l->l_tmo_aio);
nni_aio_stop(&l->l_acc_aio);
- l->l_ops.l_close(l->l_data);
+ if (l->l_ops.l_stop) {
+ l->l_ops.l_stop(l->l_data);
+ }
}
nni_sock *