aboutsummaryrefslogtreecommitdiff
path: root/src/core/platform.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-11-13 21:10:03 -0800
committerGarrett D'Amore <garrett@damore.org>2017-11-13 21:10:03 -0800
commite8694d15d0a108895bf869f292d59e11d834361e (patch)
treed87b8d396953fee653fbcbee92521395d0cec1fe /src/core/platform.h
parentac6019bfabac887274fb9d8b2a167df940ba6121 (diff)
downloadnng-e8694d15d0a108895bf869f292d59e11d834361e.tar.gz
nng-e8694d15d0a108895bf869f292d59e11d834361e.tar.bz2
nng-e8694d15d0a108895bf869f292d59e11d834361e.zip
fixes #154 underlyng TCP & IPC transports should support partial recv/send
fixes #155 POSIX TCP & IPC could avoid a lot of context switches
Diffstat (limited to 'src/core/platform.h')
-rw-r--r--src/core/platform.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/platform.h b/src/core/platform.h
index bff7f709..9e193175 100644
--- a/src/core/platform.h
+++ b/src/core/platform.h
@@ -229,8 +229,17 @@ extern void nni_plat_tcp_pipe_close(nni_plat_tcp_pipe *);
// The platform may modify the iovs.
extern void nni_plat_tcp_pipe_send(nni_plat_tcp_pipe *, nni_aio *);
-// nni_plat_tcp_pipe_recv recvs data into the buffers provided by the iovs.
-// The platform may modify the iovs.
+// nni_plat_tcp_pipe_recv receives data into the buffers provided by the
+// I/O vector (iovs). The platform should attempt to scatter the received
+// data into the iovs if possible.
+//
+// It is an error for the caller to supply any IO vector elements with
+// zero length.
+//
+// It is possible for the TCP reader to return less data than is requested,
+// in which case the caller is responsible for resubmitting. The platform
+// should not return "zero" data however. (It is an error to attempt to
+// receive zero bytes.) The platform may not modify the I/O vector.
extern void nni_plat_tcp_pipe_recv(nni_plat_tcp_pipe *, nni_aio *);
// nni_plat_tcp_pipe_peername gets the peer name.