diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-05 18:02:22 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-05 18:02:22 -0800 |
| commit | 1b6e9985960a1079be81a576d52aa7f3fe47c92b (patch) | |
| tree | 2f6c9b33571cf30e28ca721064a9c0d038be4c42 /src/core/socket.h | |
| parent | b17703d1e708a99e9a46ceb012676dc89df40df5 (diff) | |
| download | nng-1b6e9985960a1079be81a576d52aa7f3fe47c92b.tar.gz nng-1b6e9985960a1079be81a576d52aa7f3fe47c92b.tar.bz2 nng-1b6e9985960a1079be81a576d52aa7f3fe47c92b.zip | |
Add nng_shutdown() for sockets to help avoid close race.
Also we added a two phase shutdown for threads.
Diffstat (limited to 'src/core/socket.h')
| -rw-r--r-- | src/core/socket.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/socket.h b/src/core/socket.h index 5a0dbb84..68a7bc1c 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -37,6 +37,7 @@ struct nng_socket { nni_list s_reaps; // pipes to reap nni_thr s_reaper; + int s_ep_pend; // EP dial/listen in progress int s_closing; // Socket is closing int s_besteffort; // Best effort mode delivery int s_senderr; // Protocol state machine use @@ -46,7 +47,8 @@ struct nng_socket { }; extern int nni_sock_open(nni_sock **, uint16_t); -extern int nni_sock_close(nni_sock *); +extern void nni_sock_close(nni_sock *); +extern int nni_sock_shutdown(nni_sock *); extern uint16_t nni_sock_proto(nni_sock *); extern uint16_t nni_sock_peer(nni_sock *); extern int nni_sock_setopt(nni_sock *, int, const void *, size_t); |
