Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions compio-net/src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ impl TcpListener {
}

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

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

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

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

Expand All @@ -571,6 +584,9 @@ impl AsyncReadAncillaryMulti for TcpStream {
}
}

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

Expand Down
12 changes: 12 additions & 0 deletions compio-net/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ impl UdpSocket {
/// If `len` == 0, will use buffer pool's inner buffer size as the max len
/// of each buffer; if `len` > 0, `min(len, inner buffer size)` will be
/// the read max len of each buffer.
///
/// ## Platform specific
/// * io-uring: an old kernel may not support multishot operations, in which
/// case this method will return an error in the first item of the stream.
pub fn recv_multi(&self, len: usize) -> impl Stream<Item = io::Result<BufferRef>> {
self.inner.recv_multi(len, 0)
}
Expand Down Expand Up @@ -292,6 +296,10 @@ impl UdpSocket {

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

/// Receives multiple single datagram messages and ancillary data on the
/// socket from the runtime's buffer pool.
///
/// ## Platform specific
/// * io-uring: an old kernel may not support multishot operations, in which
/// case this method will return an error in the first item of the stream.
pub fn recv_msg_multi(
&self,
control_len: usize,
Expand Down
16 changes: 16 additions & 0 deletions compio-net/src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ impl UnixListener {
}

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

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

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

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

Expand All @@ -435,6 +448,9 @@ impl AsyncReadAncillaryMulti for UnixStream {
}
}

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

Expand Down