aboutsummaryrefslogtreecommitdiff
path: root/src/nng.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nng.h')
-rw-r--r--src/nng.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nng.h b/src/nng.h
index a25cb25c..24689f96 100644
--- a/src/nng.h
+++ b/src/nng.h
@@ -53,6 +53,12 @@ typedef struct nng_snapshot nng_snapshot;
typedef struct nng_stat nng_stat;
typedef struct nng_aio nng_aio;
+// Scatter/gather I/O.
+typedef struct nng_iov {
+ void * iov_buf;
+ size_t iov_len;
+} nng_iov;
+
// Some definitions for durations used with timeouts.
#define NNG_DURATION_INFINITE (-1)
#define NNG_DURATION_DEFAULT (-2)
@@ -298,6 +304,12 @@ NNG_DECL nng_msg *nng_aio_get_msg(nng_aio *);
// that any socket specific timeout should be used.
NNG_DECL void nng_aio_set_timeout(nng_aio *, nng_duration);
+// nng_aio_set_iov sets a scatter/gather vector on the aio. The iov array
+// itself is copied. Data members (the memory regions referenced) *may* be
+// copied as well, depending on the operation. This operation is guaranteed
+// to succeed if n <= 4, otherwise it may fail due to NNG_ENOMEM.
+NNG_DECL int nng_aio_set_iov(nng_aio *, int, nng_iov *);
+
// Message API.
NNG_DECL int nng_msg_alloc(nng_msg **, size_t);
NNG_DECL void nng_msg_free(nng_msg *);