Skip to content

Commit 95b62fb

Browse files
authored
docs(net): multishot on io-uring (#860)
1 parent d61df0b commit 95b62fb

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

compio-net/src/tcp.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ impl TcpListener {
116116
}
117117

118118
/// Returns a stream of incoming connections to this listener.
119+
///
120+
/// ## Platform specific
121+
/// * io-uring: an old kernel may not support multishot operations, in which
122+
/// case this method will return an error in the first item of the stream.
119123
pub fn incoming(&self) -> TcpIncoming<'_> {
120124
TcpIncoming {
121125
inner: self.inner.incoming(),
@@ -476,12 +480,18 @@ impl AsyncReadManaged for &TcpStream {
476480
}
477481
}
478482

483+
/// ## Platform specific
484+
/// * io-uring: an old kernel may not support multishot operations, in which
485+
/// case this method will return an error in the first item of the stream.
479486
impl AsyncReadMulti for TcpStream {
480487
fn read_multi(&mut self, len: usize) -> impl Stream<Item = io::Result<Self::Buffer>> {
481488
self.inner.recv_multi(len, 0)
482489
}
483490
}
484491

492+
/// ## Platform specific
493+
/// * io-uring: an old kernel may not support multishot operations, in which
494+
/// case this method will return an error in the first item of the stream.
485495
impl AsyncReadMulti for &TcpStream {
486496
fn read_multi(&mut self, len: usize) -> impl Stream<Item = io::Result<Self::Buffer>> {
487497
self.inner.recv_multi(len, 0)
@@ -559,6 +569,9 @@ impl AsyncReadAncillaryManaged for &TcpStream {
559569
}
560570
}
561571

572+
/// ## Platform specific
573+
/// * io-uring: an old kernel may not support multishot operations, in which
574+
/// case this method will return an error in the first item of the stream.
562575
impl AsyncReadAncillaryMulti for TcpStream {
563576
type Return = RecvMsgMultiResult;
564577

@@ -571,6 +584,9 @@ impl AsyncReadAncillaryMulti for TcpStream {
571584
}
572585
}
573586

587+
/// ## Platform specific
588+
/// * io-uring: an old kernel may not support multishot operations, in which
589+
/// case this method will return an error in the first item of the stream.
574590
impl AsyncReadAncillaryMulti for &TcpStream {
575591
type Return = RecvMsgMultiResult;
576592

compio-net/src/udp.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ impl UdpSocket {
221221
/// If `len` == 0, will use buffer pool's inner buffer size as the max len
222222
/// of each buffer; if `len` > 0, `min(len, inner buffer size)` will be
223223
/// the read max len of each buffer.
224+
///
225+
/// ## Platform specific
226+
/// * io-uring: an old kernel may not support multishot operations, in which
227+
/// case this method will return an error in the first item of the stream.
224228
pub fn recv_multi(&self, len: usize) -> impl Stream<Item = io::Result<BufferRef>> {
225229
self.inner.recv_multi(len, 0)
226230
}
@@ -292,6 +296,10 @@ impl UdpSocket {
292296

293297
/// Read some bytes from this source and the runtime's buffer pool and
294298
/// return a stream of [`RecvFromMultiResult`].
299+
///
300+
/// ## Platform specific
301+
/// * io-uring: an old kernel may not support multishot operations, in which
302+
/// case this method will return an error in the first item of the stream.
295303
pub fn recv_from_multi(&self) -> impl Stream<Item = io::Result<RecvFromMultiResult>> {
296304
self.inner.recv_from_multi(0)
297305
}
@@ -361,6 +369,10 @@ impl UdpSocket {
361369

362370
/// Receives multiple single datagram messages and ancillary data on the
363371
/// socket from the runtime's buffer pool.
372+
///
373+
/// ## Platform specific
374+
/// * io-uring: an old kernel may not support multishot operations, in which
375+
/// case this method will return an error in the first item of the stream.
364376
pub fn recv_msg_multi(
365377
&self,
366378
control_len: usize,

compio-net/src/unix.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ impl UnixListener {
110110
}
111111

112112
/// Returns a stream of incoming connections to this listener.
113+
///
114+
/// ## Platform specific
115+
/// * io-uring: an old kernel may not support multishot operations, in which
116+
/// case this method will return an error in the first item of the stream.
113117
pub fn incoming(&self) -> UnixIncoming<'_> {
114118
UnixIncoming {
115119
inner: self.inner.incoming(),
@@ -340,12 +344,18 @@ impl AsyncReadManaged for &UnixStream {
340344
}
341345
}
342346

347+
/// ## Platform specific
348+
/// * io-uring: an old kernel may not support multishot operations, in which
349+
/// case this method will return an error in the first item of the stream.
343350
impl AsyncReadMulti for UnixStream {
344351
fn read_multi(&mut self, len: usize) -> impl Stream<Item = io::Result<Self::Buffer>> {
345352
self.inner.recv_multi(len, 0)
346353
}
347354
}
348355

356+
/// ## Platform specific
357+
/// * io-uring: an old kernel may not support multishot operations, in which
358+
/// case this method will return an error in the first item of the stream.
349359
impl AsyncReadMulti for &UnixStream {
350360
fn read_multi(&mut self, len: usize) -> impl Stream<Item = io::Result<Self::Buffer>> {
351361
self.inner.recv_multi(len, 0)
@@ -423,6 +433,9 @@ impl AsyncReadAncillaryManaged for &UnixStream {
423433
}
424434
}
425435

436+
/// ## Platform specific
437+
/// * io-uring: an old kernel may not support multishot operations, in which
438+
/// case this method will return an error in the first item of the stream.
426439
impl AsyncReadAncillaryMulti for UnixStream {
427440
type Return = RecvMsgMultiResult;
428441

@@ -435,6 +448,9 @@ impl AsyncReadAncillaryMulti for UnixStream {
435448
}
436449
}
437450

451+
/// ## Platform specific
452+
/// * io-uring: an old kernel may not support multishot operations, in which
453+
/// case this method will return an error in the first item of the stream.
438454
impl AsyncReadAncillaryMulti for &UnixStream {
439455
type Return = RecvMsgMultiResult;
440456

0 commit comments

Comments
 (0)