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/core/platform.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/platform.h b/src/core/platform.h index e6eac8e3..08fcdb1c 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -216,7 +216,7 @@ extern int nni_plat_tcp_aio_recv(nni_plat_tcpsock *, nni_aio *); // nni_plat_ipc_init initializes the socket, for example it can // set underlying file descriptors to -1, etc. -extern int nni_plat_ipc_init(nni_plat_ipcsock *); +extern int nni_plat_ipc_init(nni_plat_ipcsock **); // nni_plat_ipc_fini just closes an IPC socket, and releases any related // resources. @@ -241,15 +241,15 @@ extern int nni_plat_ipc_accept(nni_plat_ipcsock *, nni_plat_ipcsock *); // nni_plat_ipc_connect is the client side. extern int nni_plat_ipc_connect(nni_plat_ipcsock *, const char *); -// nni_plat_ipc_send sends data to the peer. The platform is responsible +// nni_plat_ipc_aio_send sends data to the peer. The platform is responsible // for attempting to send all of the data. The iov count will never be // larger than 4. The platform may modify the iovs. -extern int nni_plat_ipc_send(nni_plat_ipcsock *, nni_iov *, int); +extern int nni_plat_ipc_aio_send(nni_plat_ipcsock *, nni_aio *); -// nni_plat_ipc_recv recvs data into the buffers provided by the +// nni_plat_ipc_aio_recv recvs data into the buffers provided by the // iovs. The implementation does not return until the iovs are completely // full, or an error condition occurs. -extern int nni_plat_ipc_recv(nni_plat_ipcsock *, nni_iov *, int); +extern int nni_plat_ipc_aio_recv(nni_plat_ipcsock *, nni_aio *); // nni_plat_seed_prng seeds the PRNG subsystem. The specified number // of bytes of entropy should be stashed. When possible, cryptographic @@ -281,6 +281,12 @@ extern void nni_plat_pipe_clear(int); // routine. extern void nni_plat_pipe_close(int, int); +// XXX: Stuff to REMOVE +extern int nni_plat_tcp_send(nni_plat_tcpsock *, nni_iov *, int); +extern int nni_plat_tcp_recv(nni_plat_tcpsock *, nni_iov *, int); +extern int nni_plat_ipc_send(nni_plat_ipcsock *, nni_iov *, int); +extern int nni_plat_ipc_recv(nni_plat_ipcsock *, nni_iov *, int); + // Actual platforms we support. This is included up front so that we can // get the specific types that are supplied by the platform. #if defined(PLATFORM_POSIX) -- cgit v1.2.3-70-g09d2