From 3a421d08f87b8b34786ac47e30552fbdb2cf4371 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 1 Jan 2017 19:14:26 -0800 Subject: Endpoint uses single thread. --- src/core/endpt.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/core/endpt.h') diff --git a/src/core/endpt.h b/src/core/endpt.h index 73ed3243..757d58ce 100644 --- a/src/core/endpt.h +++ b/src/core/endpt.h @@ -21,16 +21,18 @@ struct nng_endpt { nni_list_node ep_node; // Per socket list nni_socket * ep_sock; char ep_addr[NNG_MAXADDRLEN]; - nni_thread * ep_dialer; - nni_thread * ep_listener; - int ep_stop; // thread exits before start - int ep_start; // start thread running + nni_thr ep_thr; + int ep_mode; int ep_close; // full shutdown int ep_bound; // true if we bound locally nni_cond ep_cv; nni_pipe * ep_pipe; // Connected pipe (dialers only) }; +#define NNI_EP_MODE_IDLE 0 +#define NNI_EP_MODE_DIAL 1 +#define NNI_EP_MODE_LISTEN 2 + extern int nni_endpt_create(nni_endpt **, nni_socket *, const char *); extern int nni_endpt_accept(nni_endpt *, nni_pipe **); extern void nni_endpt_close(nni_endpt *); -- cgit v1.2.3-70-g09d2