diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-02 16:01:22 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-03 06:41:19 -0700 |
| commit | 159dc95695515db767e208c41d5f44b334b71adc (patch) | |
| tree | 5390251d939c33b1d274d0767861d2012673e258 /src/core/pipe.h | |
| parent | 649e5d5ca9a03cef766e944c7735aab50041c012 (diff) | |
| download | nng-159dc95695515db767e208c41d5f44b334b71adc.tar.gz nng-159dc95695515db767e208c41d5f44b334b71adc.tar.bz2 nng-159dc95695515db767e208c41d5f44b334b71adc.zip | |
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.)
Diffstat (limited to 'src/core/pipe.h')
| -rw-r--r-- | src/core/pipe.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 *); |
