aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nng.c b/src/nng.c
index cb340184..b05667c4 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -48,6 +48,22 @@ nng_socket_protocol(nng_socket *s)
return (nni_socket_proto(s));
}
+int
+nng_recvmsg(nng_socket *s, nng_msg **msgp, int flags)
+{
+ int rv;
+ nni_duration expire;
+ if ((rv = nni_init()) != 0) {
+ return (rv);
+ }
+ if (flags == NNG_FLAG_NONBLOCK) {
+ expire = 0;
+ } else {
+ // XXX: revise this timeout from socket option!!
+ expire = 1000000;
+ }
+ return (nni_socket_recvmsg(s, msgp, expire));
+}
// Misc.
const char *