aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nng.c b/src/nng.c
index 9ca21159..23ab4319 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -30,7 +30,9 @@ nng_open(nng_socket *sidp, uint16_t proto)
return (rv);
}
*sidp = nni_sock_id(sock);
- nni_sock_rele(sock);
+
+ // Keep the socket "held" until it is explicitly closed.
+
return (0);
}
@@ -58,7 +60,7 @@ nng_close(nng_socket sid)
// Close is special, because we still want to be able to get
// a hold on the socket even if shutdown was called.
- if ((rv = nni_sock_hold_close(&sock, sid)) != 0) {
+ if ((rv = nni_sock_hold(&sock, sid)) != 0) {
return (rv);
}
// No release -- close releases it.