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/endpt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/endpt.h') diff --git a/src/core/endpt.h b/src/core/endpt.h index 71d3ff59..36f55de2 100644 --- a/src/core/endpt.h +++ b/src/core/endpt.h @@ -18,7 +18,7 @@ struct nng_endpt { nni_endpt_ops ep_ops; void * ep_data; // Transport private - nni_list_node ep_sock_node; // Per socket list + nni_list_node ep_node; // Per socket list nni_socket * ep_sock; char ep_addr[NNG_MAXADDRLEN]; nni_thread * ep_dialer; @@ -26,6 +26,7 @@ struct nng_endpt { int ep_stop; // thread exits before start int ep_start; // start thread running int ep_close; // full shutdown + int ep_bound; // true if we bound locally nni_mutex ep_mx; nni_cond ep_cv; nni_pipe * ep_pipe; // Connected pipe (dialers only) @@ -33,9 +34,9 @@ struct nng_endpt { extern int nni_endpt_create(nni_endpt **, nni_socket *, const char *); extern void nni_endpt_destroy(nni_endpt *); -extern int nni_endpt_listen(nni_endpt *); extern int nni_endpt_accept(nni_endpt *, nni_pipe **); extern void nni_endpt_close(nni_endpt *); extern int nni_endpt_dial(nni_endpt *, int); +extern int nni_endpt_listen(nni_endpt *, int); #endif // CORE_ENDPT_H -- cgit v1.2.3-70-g09d2