aboutsummaryrefslogtreecommitdiff
path: root/src/core/socket.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-17 12:54:01 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-17 19:29:37 -0700
commit70d478f5d185e147ca8d3dcba4cbd8bb6da3719a (patch)
tree443e3b0e81138d7c195660d45eca7d4d497af8ac /src/core/socket.h
parente490aa3353f05e158a0f1f485f371cd49e70b4f5 (diff)
downloadnng-70d478f5d185e147ca8d3dcba4cbd8bb6da3719a.tar.gz
nng-70d478f5d185e147ca8d3dcba4cbd8bb6da3719a.tar.bz2
nng-70d478f5d185e147ca8d3dcba4cbd8bb6da3719a.zip
fixes #449 Want more flexible pipe events
This changes the signature of nng_pipe_notify(), and the associated events. The documentation is updated to reflect this. We have also broken the lock up so that we don't hold the master socket lock for some of these things, which may have beneficial impact on performance.
Diffstat (limited to 'src/core/socket.h')
-rw-r--r--src/core/socket.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/socket.h b/src/core/socket.h
index 22a13ef7..833129fa 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -44,7 +44,6 @@ extern uint32_t nni_sock_id(nni_sock *);
// a pipe could wind up orphaned.
extern int nni_sock_pipe_add(nni_sock *, nni_pipe *);
extern void nni_sock_pipe_remove(nni_sock *, nni_pipe *);
-extern int nni_sock_pipe_start(nni_sock *, nni_pipe *);
extern int nni_sock_ep_add(nni_sock *, nni_ep *);
extern void nni_sock_ep_remove(nni_sock *, nni_ep *);
@@ -71,8 +70,13 @@ extern uint32_t nni_sock_flags(nni_sock *);
// one of the only cases (the only?) where the socket core understands
// the public data types. (Other solutions might exist, but they require
// keeping extra state to support conversion between public and internal
-// types.)
-extern void nni_sock_set_pipe_cb(nni_sock *sock, nng_pipe_cb, void *);
+// types.) The second argument is a mask of events for which the callback
+// should be executed.
+extern void nni_sock_set_pipe_cb(nni_sock *sock, int, nng_pipe_cb, void *);
+
+extern void nni_sock_run_pipe_cb(nni_sock *sock, int, uint32_t);
+
+extern bool nni_sock_closing(nni_sock *sock);
// nni_ctx_open is used to open/create a new context structure.
// Contexts are not supported by most protocols, but for those that do,