summaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-16 22:22:07 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-16 22:22:07 -0800
commit4e46e666e47e277316cc680c833356045932bb5f (patch)
treed6888f69674a93a3c0a82baafc268773c7bb2976 /src/nng.c
parent50e1484af0d443b46aa04fd4a8096b157dc160aa (diff)
downloadnng-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/nng.c')
-rw-r--r--src/nng.c30
1 files changed, 30 insertions, 0 deletions
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)