From 86eaf052cc535658783dd5c3d5925f58fd70f983 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 29 Mar 2017 17:05:08 -0700 Subject: IPC send/recv works asynchronously for POSIX. As with TCP, we're still using threads under the hood. But this completes the send/recv logic conversion for POSIX to our AIO framework, and hence represents a substantial milestone towards full asyncronous operation. We still need to do accept/connect operations asynchronously, then making. Windows overlapped IO work properly. After that, poll/epoll/kqueue, etc. --- src/platform/posix/posix_net.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/platform/posix/posix_net.c') diff --git a/src/platform/posix/posix_net.c b/src/platform/posix/posix_net.c index c7651655..94dc2667 100644 --- a/src/platform/posix/posix_net.c +++ b/src/platform/posix/posix_net.c @@ -8,9 +8,9 @@ // #include "core/nng_impl.h" -#include "platform/posix/posix_aio.h" #ifdef PLATFORM_POSIX_NET +#include "platform/posix/posix_aio.h" #include #include @@ -31,13 +31,11 @@ #define NNI_TCP_SOCKTYPE SOCK_STREAM #endif -#ifdef PLATFORM_POSIX_NET struct nni_plat_tcpsock { int fd; - int devnull; // used for shutting down blocking accept() + int devnull; // for shutting down accept() nni_posix_aio_pipe aiop; }; -#endif static int nni_plat_to_sockaddr(struct sockaddr_storage *ss, const nni_sockaddr *sa) @@ -284,6 +282,7 @@ nni_plat_tcp_fini(nni_plat_tcpsock *tsp) (void) close(tsp->fd); tsp->fd = -1; } + nni_posix_aio_pipe_fini(&tsp->aiop); NNI_FREE_STRUCT(tsp); } -- cgit v1.2.3-70-g09d2