diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-06-24 14:11:35 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-06-24 14:11:35 -0700 |
| commit | 0a51aa7bfc88d55b98fdde0d497b072e6911457d (patch) | |
| tree | 722ef4713bf27a9aac9dce0a1fe9fa0edfe34a2d /src/core/socket.h | |
| parent | d753c00d43e6dc642b2445e4821537a92b8b8d23 (diff) | |
| download | nng-0a51aa7bfc88d55b98fdde0d497b072e6911457d.tar.gz nng-0a51aa7bfc88d55b98fdde0d497b072e6911457d.tar.bz2 nng-0a51aa7bfc88d55b98fdde0d497b072e6911457d.zip | |
Protocols keep their own reference counts.
Diffstat (limited to 'src/core/socket.h')
| -rw-r--r-- | src/core/socket.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/core/socket.h b/src/core/socket.h index 68f05705..7d5e0f20 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -85,18 +85,19 @@ extern void nni_sock_unlock(nni_sock *); extern nni_notify *nni_sock_notify(nni_sock *, int, nng_notify_func, void *); extern void nni_sock_unnotify(nni_sock *, nni_notify *); -extern int nni_sock_add_ep(nni_sock *, nni_ep *); -extern void nni_sock_rem_ep(nni_sock *, nni_ep *); +extern int nni_sock_ep_add(nni_sock *, nni_ep *); +extern void nni_sock_ep_remove(nni_sock *, nni_ep *); // nni_sock_pipe_add is called by the pipe to register the pipe with // with the socket. The pipe is added to the idle list. The protocol // private pipe data is initialized as well. extern int nni_sock_pipe_add(nni_sock *, nni_pipe *); -// nni_sock_pipe_rem deregisters the pipe from the socket. The socket -// will block during close if there are registered pipes outstanding. -// This also frees any protocol private pipe data. -extern void nni_sock_pipe_rem(nni_sock *, nni_pipe *); +// nni_sock_pipe_remove is called by the pipe when the protocol is +// done with it. This is the sockets indication that it should be +// removed, and freed. The protocol MUST guarantee that the pipe is +// no longer in use when this function is called. +extern void nni_sock_pipe_remove(nni_sock *, nni_pipe *); // nni_sock_pipe_ready lets the socket know the pipe is ready for // business. This also calls the socket/protocol specific add function, @@ -104,12 +105,6 @@ extern void nni_sock_pipe_rem(nni_sock *, nni_pipe *); // on success. The reference count should be dropped by nni_sock_pipe_closed. extern int nni_sock_pipe_ready(nni_sock *, nni_pipe *); -// nni_sock_pipe_closed lets the socket know that the pipe is closed. -// This keeps the socket from trying to schedule traffic to it. It -// also lets the endpoint know about it, to possibly restart a dial -// operation. -extern void nni_sock_pipe_closed(nni_sock *, nni_pipe *); - // Set error codes for applications. These are only ever // called from the filter functions in protocols, and thus // already have the socket lock held. |
