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/nng.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/nng.c') diff --git a/src/nng.c b/src/nng.c index ec221fb7..723b230e 100644 --- a/src/nng.c +++ b/src/nng.c @@ -144,6 +144,36 @@ nng_getopt(nng_socket *s, int opt, void *val, size_t *szp) } +nng_notify * +nng_setnotify(nng_socket *sock, int mask, nng_notify_func fn, void *arg) +{ + NNI_INIT_VOID(); + return (nni_add_notify(sock, mask, fn, arg)); +} + + +void +nng_unsetnotify(nng_socket *sock, nng_notify *notify) +{ + NNI_INIT_VOID(); + nni_rem_notify(sock, notify); +} + + +nng_socket * +nng_event_socket(nng_event *ev) +{ + return (ev->e_sock); +} + + +int +nng_event_type(nng_event *ev) +{ + return (ev->e_type); +} + + // Misc. const char * nng_strerror(int num) -- cgit v1.2.3-70-g09d2