aboutsummaryrefslogtreecommitdiff
path: root/src/core/endpt.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-01 19:14:26 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-01 19:14:26 -0800
commit3a421d08f87b8b34786ac47e30552fbdb2cf4371 (patch)
treecc430dedd312cb670c8c8b7c29dcfd01e8e08d75 /src/core/endpt.h
parentf26dea6463adce8d70e1a4b22d8f9a867cf672c6 (diff)
downloadnng-3a421d08f87b8b34786ac47e30552fbdb2cf4371.tar.gz
nng-3a421d08f87b8b34786ac47e30552fbdb2cf4371.tar.bz2
nng-3a421d08f87b8b34786ac47e30552fbdb2cf4371.zip
Endpoint uses single thread.
Diffstat (limited to 'src/core/endpt.h')
-rw-r--r--src/core/endpt.h10
1 files changed, 6 insertions, 4 deletions
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 *);