aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nng.c b/src/nng.c
index 98442a83..54df9980 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -160,6 +160,13 @@ nng_recvmsg(nng_socket sid, nng_msg **msgp, int flags)
rv = nni_sock_recvmsg(sock, msgp, expire);
nni_sock_rele(sock);
+
+ // Possibly massage nonblocking attempt. Note that nonblocking is
+ // still done asynchronously, and the calling thread loses context.
+ if ((rv == NNG_ETIMEDOUT) && (expire == NNI_TIME_ZERO)) {
+ rv = NNG_EAGAIN;
+ }
+
return (rv);
}
@@ -214,6 +221,13 @@ nng_sendmsg(nng_socket sid, nng_msg *msg, int flags)
rv = nni_sock_sendmsg(sock, msg, expire);
nni_sock_rele(sock);
+
+ // Possibly massage nonblocking attempt. Note that nonblocking is
+ // still done asynchronously, and the calling thread loses context.
+ if ((rv == NNG_ETIMEDOUT) && (expire == NNI_TIME_ZERO)) {
+ rv = NNG_EAGAIN;
+ }
+
return (rv);
}