diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-25 18:08:44 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-25 18:08:44 -0800 |
| commit | 0cd2fa7310f1fdf45443a8a9e3335658b1c3c64c (patch) | |
| tree | 1098c7f4976033bb311b45c378079700c9330b62 /src/core/socket.h | |
| parent | 64de60d98e8e4a896f9d13e4aa70343f329d88b4 (diff) | |
| download | nng-0cd2fa7310f1fdf45443a8a9e3335658b1c3c64c.tar.gz nng-0cd2fa7310f1fdf45443a8a9e3335658b1c3c64c.tar.bz2 nng-0cd2fa7310f1fdf45443a8a9e3335658b1c3c64c.zip | |
Substantial fixes for listen & dialers.
At this point listening and dialing operations appear to function properly.
As part of this I had to break the close logic up since otherwise we had a
loop trying to reap a thread from itself. So there is now a separate reaper
thread for pipes per-socket. I also changed lists to be a bit more rigid,
and allocations now zero memory initially. (We had bugs due to uninitialized
memory, and rather than hunt them all down, lets just init them to sane zero
values.)
Diffstat (limited to 'src/core/socket.h')
| -rw-r--r-- | src/core/socket.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/socket.h b/src/core/socket.h index 4e1ea166..37a0e5eb 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -34,6 +34,9 @@ struct nng_socket { nni_list s_eps; // active endpoints nni_list s_pipes; // pipes for this socket + nni_list s_reaps; // pipes to reap + nni_thread * s_reaper; + int s_closing; // Socket is closing int s_besteffort; // Best effort mode delivery int s_senderr; // Protocol state machine use @@ -44,8 +47,7 @@ struct nng_socket { extern int nni_socket_create(nni_socket **, uint16_t); extern int nni_socket_close(nni_socket *); -extern int nni_socket_add_pipe(nni_socket *, nni_pipe *, int); -extern void nni_socket_rem_pipe(nni_socket *, nni_pipe *); +extern int nni_socket_add_pipe(nni_socket *, nni_pipe *); extern uint16_t nni_socket_proto(nni_socket *); extern int nni_socket_setopt(nni_socket *, int, const void *, size_t); extern int nni_socket_getopt(nni_socket *, int, void *, size_t *); |
