From 4e46e666e47e277316cc680c833356045932bb5f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 16 Jan 2017 22:22:07 -0800 Subject: External event API for send/recv implemented. This was the main blocker, I think, for the nanomsg legacy compat shim. Now that we have this, it should be relatively straight-forward to implement the legacy nanomsg API, including the SENDFD, RECVFD thing. --- src/core/socket.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index 734e4da8..1e9fe11f 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -232,8 +232,12 @@ nni_sock_open(nni_sock **sockp, uint16_t pnum) goto fail; } - if (((rv = nni_ev_init(&sock->s_recv_ev, NNG_EVENT_RECV, sock)) != 0) || - ((rv = nni_ev_init(&sock->s_send_ev, NNG_EVENT_SEND, sock)) != 0)) { + rv = nni_ev_init(&sock->s_recv_ev, NNG_EV_CAN_RECV, sock); + if (rv != 0) { + goto fail; + } + rv = nni_ev_init(&sock->s_send_ev, NNG_EV_CAN_SEND, sock); + if (rv != 0) { goto fail; } -- cgit v1.2.3-70-g09d2