aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/defs.h4
-rw-r--r--src/core/platform.h13
2 files changed, 13 insertions, 4 deletions
diff --git a/src/core/defs.h b/src/core/defs.h
index 57f7f06a..5a9ded92 100644
--- a/src/core/defs.h
+++ b/src/core/defs.h
@@ -62,8 +62,8 @@ typedef void (*nni_cb)(void *);
// Used by transports for scatter gather I/O.
typedef struct {
- void * iov_buf;
- size_t iov_len;
+ uint8_t *iov_buf;
+ size_t iov_len;
} nni_iov;
// Notify descriptor.
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.