diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-16 22:22:07 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-16 22:22:07 -0800 |
| commit | 4e46e666e47e277316cc680c833356045932bb5f (patch) | |
| tree | d6888f69674a93a3c0a82baafc268773c7bb2976 /src/core/socket.c | |
| parent | 50e1484af0d443b46aa04fd4a8096b157dc160aa (diff) | |
| download | nng-4e46e666e47e277316cc680c833356045932bb5f.tar.gz nng-4e46e666e47e277316cc680c833356045932bb5f.tar.bz2 nng-4e46e666e47e277316cc680c833356045932bb5f.zip | |
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.
Diffstat (limited to 'src/core/socket.c')
| -rw-r--r-- | src/core/socket.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |
