diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-10-25 15:00:52 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-10-25 18:29:47 -0700 |
| commit | 9cbdeda1d0a9074bd65da2aaf9c87b79545a1590 (patch) | |
| tree | 98254532f75a58cde92c837b4829bd2b3982db7a /src/protocol/pipeline | |
| parent | b28838f5cf3c5fed494d2684422099d26e8ab293 (diff) | |
| download | nng-9cbdeda1d0a9074bd65da2aaf9c87b79545a1590.tar.gz nng-9cbdeda1d0a9074bd65da2aaf9c87b79545a1590.tar.bz2 nng-9cbdeda1d0a9074bd65da2aaf9c87b79545a1590.zip | |
fixes #45 expose aio to applications
While here we added a test for the aio stuff, and cleaned up some dead
code for the old fd notifications. There were a few improvements to
shorten & clean code elsewhere, such as short-circuiting task wait
when the task has no callback.
The legacy sendmsg() and recvmsg() APIs are still in the socket core
until we convert the device code to use the aios.
Diffstat (limited to 'src/protocol/pipeline')
| -rw-r--r-- | src/protocol/pipeline/pull.c | 7 | ||||
| -rw-r--r-- | src/protocol/pipeline/push.c | 9 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/protocol/pipeline/pull.c b/src/protocol/pipeline/pull.c index 7dd0c8ed..267352c5 100644 --- a/src/protocol/pipeline/pull.c +++ b/src/protocol/pipeline/pull.c @@ -26,7 +26,6 @@ static void pull_putq(pull_pipe *, nni_msg *); struct pull_sock { nni_msgq *urq; int raw; - nni_sock *sock; }; // A pull_pipe is our per-pipe protocol private structure. @@ -45,9 +44,8 @@ pull_sock_init(void **sp, nni_sock *sock) if ((s = NNI_ALLOC_STRUCT(s)) == NULL) { return (NNG_ENOMEM); } - s->raw = 0; - s->urq = nni_sock_recvq(sock); - s->sock = sock; + s->raw = 0; + s->urq = nni_sock_recvq(sock); *sp = s; return (0); @@ -198,7 +196,6 @@ pull_sock_recv(void *arg, nni_aio *aio) { pull_sock *s = arg; - nni_sock_recv_pending(s->sock); nni_msgq_aio_get(s->urq, aio); } diff --git a/src/protocol/pipeline/push.c b/src/protocol/pipeline/push.c index af7b80ca..995ac56d 100644 --- a/src/protocol/pipeline/push.c +++ b/src/protocol/pipeline/push.c @@ -28,7 +28,6 @@ static void push_getq_cb(void *); struct push_sock { nni_msgq *uwq; int raw; - nni_sock *sock; }; // An nni_push_pipe is our per-pipe protocol private structure. @@ -50,10 +49,9 @@ push_sock_init(void **sp, nni_sock *sock) if ((s = NNI_ALLOC_STRUCT(s)) == NULL) { return (NNG_ENOMEM); } - s->raw = 0; - s->sock = sock; - s->uwq = nni_sock_sendq(sock); - *sp = s; + s->raw = 0; + s->uwq = nni_sock_sendq(sock); + *sp = s; return (0); } @@ -209,7 +207,6 @@ push_sock_send(void *arg, nni_aio *aio) { push_sock *s = arg; - nni_sock_send_pending(s->sock); nni_msgq_aio_put(s->uwq, aio); } |
