diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-08 11:18:16 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-08 11:18:16 -0800 |
| commit | ec2574b09a746709f15d2a3f5de135e29f4bcb52 (patch) | |
| tree | 25f970232f8093b9ce94969eeed2a5f230e94a89 /src/protocol/survey | |
| parent | 360d19001b90d92ac2f232efb67e356979b0bc4b (diff) | |
| download | nng-ec2574b09a746709f15d2a3f5de135e29f4bcb52.tar.gz nng-ec2574b09a746709f15d2a3f5de135e29f4bcb52.tar.bz2 nng-ec2574b09a746709f15d2a3f5de135e29f4bcb52.zip | |
Move to generic socket & pipe workers, and up to 4 each.
This should eliminate all need for protocols to do their own
thread management tasks.
Diffstat (limited to 'src/protocol/survey')
| -rw-r--r-- | src/protocol/survey/respond.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/protocol/survey/respond.c b/src/protocol/survey/respond.c index 24c607b9..3b23dff8 100644 --- a/src/protocol/survey/respond.c +++ b/src/protocol/survey/respond.c @@ -19,18 +19,17 @@ typedef struct nni_resp_pipe nni_resp_pipe; typedef struct nni_resp_sock nni_resp_sock; -// An nni_rep_sock is our per-socket protocol private structure. +// An nni_resp_sock is our per-socket protocol private structure. struct nni_resp_sock { nni_sock * sock; int raw; int ttl; - nni_thr sender; nni_idhash * pipes; char * btrace; size_t btrace_len; }; -// An nni_rep_pipe is our per-pipe protocol private structure. +// An nni_resp_pipe is our per-pipe protocol private structure. struct nni_resp_pipe { nni_pipe * pipe; nni_resp_sock * resp; @@ -38,8 +37,6 @@ struct nni_resp_pipe { int sigclose; }; -static void nni_rep_topsender(void *); - static int nni_resp_sock_init(void **respp, nni_sock *sock) { @@ -388,8 +385,7 @@ static nni_proto_pipe_ops nni_resp_pipe_ops = { .pipe_fini = nni_resp_pipe_fini, .pipe_add = nni_resp_pipe_add, .pipe_rem = nni_resp_pipe_rem, - .pipe_send = nni_resp_pipe_send, - .pipe_recv = nni_resp_pipe_recv, + .pipe_worker = { nni_resp_pipe_send,nni_resp_pipe_recv }, }; static nni_proto_sock_ops nni_resp_sock_ops = { @@ -400,8 +396,7 @@ static nni_proto_sock_ops nni_resp_sock_ops = { .sock_getopt = nni_resp_sock_getopt, .sock_rfilter = nni_resp_sock_rfilter, .sock_sfilter = nni_resp_sock_sfilter, - .sock_send = nni_resp_sock_send, - .sock_recv = NULL, + .sock_worker = { nni_resp_sock_send }, }; nni_proto nni_respondent_proto = { |
