From 70d478f5d185e147ca8d3dcba4cbd8bb6da3719a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 17 May 2018 12:54:01 -0700 Subject: 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. --- src/core/socket.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core/socket.h') 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, -- cgit v1.2.3-70-g09d2