diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-10-20 17:03:12 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-10-23 16:14:53 -0700 |
| commit | 3585000ca027740dbdb4599f4991cd2bf562e2f2 (patch) | |
| tree | a45b4c1bcc2d11777dde0e38d4b742d121d55e45 /src/protocol/pubsub/pub.c | |
| parent | fdb73b69a887d868f8e976ef8a990a5d7f6687f9 (diff) | |
| download | nng-3585000ca027740dbdb4599f4991cd2bf562e2f2.tar.gz nng-3585000ca027740dbdb4599f4991cd2bf562e2f2.tar.bz2 nng-3585000ca027740dbdb4599f4991cd2bf562e2f2.zip | |
fixes #112 Need to move some stuff from socket to message queues
Diffstat (limited to 'src/protocol/pubsub/pub.c')
| -rw-r--r-- | src/protocol/pubsub/pub.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/protocol/pubsub/pub.c b/src/protocol/pubsub/pub.c index 03f4603a..4604d0ff 100644 --- a/src/protocol/pubsub/pub.c +++ b/src/protocol/pubsub/pub.c @@ -82,7 +82,6 @@ pub_sock_init(void **sp, nni_sock *sock) s->uwq = nni_sock_sendq(sock); *sp = s; - nni_sock_recverr(sock, NNG_ENOTSUP); return (0); } @@ -281,6 +280,21 @@ pub_sock_getopt_raw(void *arg, void *buf, size_t *szp) return (nni_getopt_int(s->raw, buf, szp)); } +static void +pub_sock_recv(void *arg, nni_aio *aio) +{ + nni_aio_finish_error(aio, NNG_ENOTSUP); +} + +static void +pub_sock_send(void *arg, nni_aio *aio) +{ + pub_sock *s = arg; + + nni_sock_send_pending(s->sock); + nni_msgq_aio_put(s->uwq, aio); +} + static nni_proto_pipe_ops pub_pipe_ops = { .pipe_init = pub_pipe_init, .pipe_fini = pub_pipe_fini, @@ -303,6 +317,8 @@ static nni_proto_sock_ops pub_sock_ops = { .sock_fini = pub_sock_fini, .sock_open = pub_sock_open, .sock_close = pub_sock_close, + .sock_send = pub_sock_send, + .sock_recv = pub_sock_recv, .sock_options = pub_sock_options, }; |
