From ac8415c24ffea645105c3859e814843e81c97f8a Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 16 Jan 2017 16:27:22 -0800 Subject: Start of event framework. This compiles correctly, but doesn't actually deliver events yet. As part of this, I've made most of the initializables in nng safe to tear-down if uninitialized (or set to zero e.g. via calloc). This makes it loads easier to write the teardown on error code, since I can deinit everything, without worrying about which things have been initialized and which have not. --- src/core/socket.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/socket.h') diff --git a/src/core/socket.h b/src/core/socket.h index 4656c5d7..d8b37252 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -37,9 +37,14 @@ struct nng_socket { nni_list s_eps; // active endpoints nni_list s_pipes; // pipes for this socket + nni_list s_events; // pending events + nni_list s_notify; // event watchers + nni_cv s_notify_cv; // wakes notify thread + nni_mtx s_notify_mx; // protects s_notify list nni_list s_reaps; // pipes to reap nni_thr s_reaper; + nni_thr s_notify_thr; nni_thr s_worker_thr[NNI_MAXWORKERS]; int s_ep_pend; // EP dial/listen in progress @@ -48,6 +53,9 @@ struct nng_socket { int s_senderr; // Protocol state machine use int s_recverr; // Protocol state machine use + nni_event s_recv_ev; // Event for readability + nni_event s_send_ev; // Event for sendability + uint32_t s_nextid; // Next Pipe ID. }; -- cgit v1.2.3-70-g09d2