aboutsummaryrefslogtreecommitdiff
path: root/src/core/platform.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-03-29 17:05:08 -0700
committerGarrett D'Amore <garrett@damore.org>2017-03-29 17:05:08 -0700
commit86eaf052cc535658783dd5c3d5925f58fd70f983 (patch)
treee7675f617b749a5a4c5aeb8ca00e0b9be6f84e2a /src/core/platform.h
parent84990c6ecb35ef322b74b8cc9e74ad5964b66ee5 (diff)
downloadnng-86eaf052cc535658783dd5c3d5925f58fd70f983.tar.gz
nng-86eaf052cc535658783dd5c3d5925f58fd70f983.tar.bz2
nng-86eaf052cc535658783dd5c3d5925f58fd70f983.zip
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.
Diffstat (limited to 'src/core/platform.h')
-rw-r--r--src/core/platform.h16
1 files changed, 11 insertions, 5 deletions
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)