From e8694d15d0a108895bf869f292d59e11d834361e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 13 Nov 2017 21:10:03 -0800 Subject: fixes #154 underlyng TCP & IPC transports should support partial recv/send fixes #155 POSIX TCP & IPC could avoid a lot of context switches --- src/core/platform.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/core/platform.h') 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. -- cgit v1.2.3-70-g09d2