diff options
| -rw-r--r-- | src/protocol/bus/bus.c | 9 | ||||
| -rw-r--r-- | src/protocol/reqrep/rep.c | 10 | ||||
| -rw-r--r-- | src/protocol/reqrep/req.c | 11 | ||||
| -rw-r--r-- | src/protocol/survey/respond.c | 10 | ||||
| -rw-r--r-- | src/protocol/survey/survey.c | 11 |
5 files changed, 27 insertions, 24 deletions
diff --git a/src/protocol/bus/bus.c b/src/protocol/bus/bus.c index 8c9ed83c..c235e60a 100644 --- a/src/protocol/bus/bus.c +++ b/src/protocol/bus/bus.c @@ -1,5 +1,6 @@ // // Copyright 2017 Garrett D'Amore <garrett@damore.org> +// Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -182,10 +183,10 @@ nni_bus_pipe_stop(void *arg) nni_msgq_close(ppipe->sendq); - nni_aio_stop(&ppipe->aio_getq); - nni_aio_stop(&ppipe->aio_send); - nni_aio_stop(&ppipe->aio_recv); - nni_aio_stop(&ppipe->aio_putq); + nni_aio_cancel(&ppipe->aio_getq, NNG_ECLOSED); + nni_aio_cancel(&ppipe->aio_send, NNG_ECLOSED); + nni_aio_cancel(&ppipe->aio_recv, NNG_ECLOSED); + nni_aio_cancel(&ppipe->aio_putq, NNG_ECLOSED); nni_mtx_lock(&ppipe->psock->mtx); if (nni_list_active(&psock->pipes, ppipe)) { diff --git a/src/protocol/reqrep/rep.c b/src/protocol/reqrep/rep.c index f35726d8..1e4ee4ef 100644 --- a/src/protocol/reqrep/rep.c +++ b/src/protocol/reqrep/rep.c @@ -114,7 +114,7 @@ nni_rep_sock_close(void *arg) { nni_rep_sock *rep = arg; - nni_aio_stop(&rep->aio_getq); + nni_aio_cancel(&rep->aio_getq, NNG_ECLOSED); } static int @@ -191,10 +191,10 @@ nni_rep_pipe_stop(void *arg) nni_rep_pipe *rp = arg; nni_rep_sock *rep = rp->rep; - nni_aio_stop(&rp->aio_getq); - nni_aio_stop(&rp->aio_putq); - nni_aio_stop(&rp->aio_send); - nni_aio_stop(&rp->aio_recv); + nni_aio_cancel(&rp->aio_getq, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_putq, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_send, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_recv, NNG_ECANCELED); nni_msgq_close(rp->sendq); nni_idhash_remove(rep->pipes, nni_pipe_id(rp->pipe)); diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c index f77700f5..f13094ff 100644 --- a/src/protocol/reqrep/req.c +++ b/src/protocol/reqrep/req.c @@ -1,5 +1,6 @@ // // Copyright 2017 Garrett D'Amore <garrett@damore.org> +// Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -209,11 +210,11 @@ nni_req_pipe_stop(void *arg) nni_req_pipe *rp = arg; nni_req_sock *req = rp->req; - nni_aio_stop(&rp->aio_getq); - nni_aio_stop(&rp->aio_putq); - nni_aio_stop(&rp->aio_recv); - nni_aio_stop(&rp->aio_sendcooked); - nni_aio_stop(&rp->aio_sendraw); + nni_aio_cancel(&rp->aio_getq, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_putq, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_recv, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_sendcooked, NNG_ECANCELED); + nni_aio_cancel(&rp->aio_sendraw, NNG_ECANCELED); // At this point there should not be any further AIOs running. // Further, any completion tasks have completed. diff --git a/src/protocol/survey/respond.c b/src/protocol/survey/respond.c index c2b8cd18..685f39fd 100644 --- a/src/protocol/survey/respond.c +++ b/src/protocol/survey/respond.c @@ -113,7 +113,7 @@ nni_resp_sock_close(void *arg) { nni_resp_sock *psock = arg; - nni_aio_stop(&psock->aio_getq); + nni_aio_cancel(&psock->aio_getq, NNG_ECLOSED); } static int @@ -195,10 +195,10 @@ nni_resp_pipe_stop(void *arg) nni_resp_sock *psock = ppipe->psock; nni_msgq_close(ppipe->sendq); - nni_aio_stop(&ppipe->aio_putq); - nni_aio_stop(&ppipe->aio_getq); - nni_aio_stop(&ppipe->aio_send); - nni_aio_stop(&ppipe->aio_recv); + nni_aio_cancel(&ppipe->aio_putq, NNG_ECANCELED); + nni_aio_cancel(&ppipe->aio_getq, NNG_ECANCELED); + nni_aio_cancel(&ppipe->aio_send, NNG_ECANCELED); + nni_aio_cancel(&ppipe->aio_recv, NNG_ECANCELED); if (ppipe->id != 0) { nni_idhash_remove(psock->pipes, ppipe->id); diff --git a/src/protocol/survey/survey.c b/src/protocol/survey/survey.c index e7d0f3ce..85657f57 100644 --- a/src/protocol/survey/survey.c +++ b/src/protocol/survey/survey.c @@ -1,5 +1,6 @@ // // Copyright 2017 Garrett D'Amore <garrett@damore.org> +// Copyright 2017 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -114,7 +115,7 @@ nni_surv_sock_close(void *arg) nni_surv_sock *psock = arg; nni_timer_cancel(&psock->timer); - nni_aio_stop(&psock->aio_getq); + nni_aio_cancel(&psock->aio_getq, NNG_ECLOSED); } static void @@ -190,10 +191,10 @@ nni_surv_pipe_stop(void *arg) nni_surv_pipe *ppipe = arg; nni_surv_sock *psock = ppipe->psock; - nni_aio_stop(&ppipe->aio_getq); - nni_aio_stop(&ppipe->aio_send); - nni_aio_stop(&ppipe->aio_recv); - nni_aio_stop(&ppipe->aio_putq); + nni_aio_cancel(&ppipe->aio_getq, NNG_ECANCELED); + nni_aio_cancel(&ppipe->aio_send, NNG_ECANCELED); + nni_aio_cancel(&ppipe->aio_recv, NNG_ECANCELED); + nni_aio_cancel(&ppipe->aio_putq, NNG_ECANCELED); nni_msgq_close(ppipe->sendq); nni_mtx_lock(&psock->mtx); |
