From 159dc95695515db767e208c41d5f44b334b71adc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 2 May 2018 16:01:22 -0700 Subject: fixes #389 Need pipe notification callbacks This adds a new pipe event notification API (callbacks called on either pipe add or remove), including both tests and docs. Also supporting APIs to get the socket or endpoint associated with a pipe are included (tested and documented as well.) --- src/core/pipe.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/pipe.h') diff --git a/src/core/pipe.h b/src/core/pipe.h index ea0c16db..18a59ddb 100644 --- a/src/core/pipe.h +++ b/src/core/pipe.h @@ -79,6 +79,20 @@ extern void nni_pipe_ep_list_init(nni_list *); // pipe, which must be released by the caller when it is done. extern int nni_pipe_find(nni_pipe **, uint32_t); +// nni_pipe_sock_id returns the socket id for the pipe (used by public API). +extern uint32_t nni_pipe_sock_id(nni_pipe *); + +// nni_pipe_ep_id returns the endpoint id for the pipe. +extern uint32_t nni_pipe_ep_id(nni_pipe *); + +// nni_pipe_ep_mode returns the endpoint mode for the pipe. +extern int nni_pipe_ep_mode(nni_pipe *); + +// nni_pipe_closed returns true if nni_pipe_close was called. +// (This is used by the socket to determine if user closed the pipe +// during callback.) +extern bool nni_pipe_closed(nni_pipe *); + // nni_pipe_rele releases the hold on the pipe placed by nni_pipe_find. extern void nni_pipe_rele(nni_pipe *); -- cgit v1.2.3-70-g09d2