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/endpt.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/endpt.h')
| -rw-r--r-- | src/core/endpt.h | 5 |
1 files changed, 3 insertions, 2 deletions
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 |
