aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-10-26 11:14:25 -0700
committerGarrett D'Amore <garrett@damore.org>2017-10-26 13:00:21 -0700
commit46ca4756a09d015298b310cd482f2e39d9a034db (patch)
tree2a18c46a1511505edb8386ac75878e984021a8cd /src/nng.c
parent9cbdeda1d0a9074bd65da2aaf9c87b79545a1590 (diff)
downloadnng-46ca4756a09d015298b310cd482f2e39d9a034db.tar.gz
nng-46ca4756a09d015298b310cd482f2e39d9a034db.tar.bz2
nng-46ca4756a09d015298b310cd482f2e39d9a034db.zip
fixes #46 make device() use aios directly
This eliminates the separate threads used for devices, letting them benefit from the new aio framework. It also eliminates the legacy nni_sock_sendmsg and nni_sock_recvmsg internal APIs. It would appear that there is an opportunity here to provide asynchronous device support out to userland as well, exposing an aio to them. That work is deferred to later.
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nng.c b/src/nng.c
index 39206941..bd403896 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -679,6 +679,12 @@ nng_device(nng_socket s1, nng_socket s2)
}
rv = nni_device(sock1, sock2);
+ if (sock1 != NULL) {
+ nni_sock_rele(sock1);
+ }
+ if (sock2 != NULL) {
+ nni_sock_rele(sock2);
+ }
return (rv);
}