From 0cd2fa7310f1fdf45443a8a9e3335658b1c3c64c Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 25 Dec 2016 18:08:44 -0800 Subject: 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.) --- src/core/socket.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/socket.h') 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 *); -- cgit v1.2.3-70-g09d2