aboutsummaryrefslogtreecommitdiff
path: root/src/sp
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/sp
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/sp')
-rw-r--r--src/sp/transport.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/sp/transport.h b/src/sp/transport.h
index 10207f28..6d1e0d4a 100644
--- a/src/sp/transport.h
+++ b/src/sp/transport.h
@@ -43,11 +43,14 @@ struct nni_sp_dialer_ops {
// NNG_ECONNFAILED, NNG_ETIMEDOUT, and NNG_EPROTO.
void (*d_connect)(void *, nni_aio *);
- // d_close stops the dialer from operating altogether. It
- // does not affect pipes that have already been created. It is
- // nonblocking.
+ // d_close stops the dialer from operating altogether.
+ // It is nonblocking.
void (*d_close)(void *);
+ // d_stop is close, but also waits for the operation to be
+ // be fully stopped.
+ void (*d_stop)(void *);
+
// d_getopt is used to obtain an option.
int (*d_getopt)(void *, const char *, void *, size_t *, nni_type);
@@ -93,11 +96,14 @@ struct nni_sp_listener_ops {
// l_accept accepts an inbound connection.
void (*l_accept)(void *, nni_aio *);
- // l_close stops the listener from operating altogether. It
- // does not affect pipes that have already been created. It is
- // nonblocking.
+ // l_close stops the listener from operating altogether.
+ // It is nonblocking.
void (*l_close)(void *);
+ // l_stop is close, but also waits for the operation to be
+ // be fully stopped.
+ void (*l_stop)(void *);
+
// l_getopt is used to obtain an option.
int (*l_getopt)(void *, const char *, void *, size_t *, nni_type);