fn read(
        &mut self,
        task: &Task,
        user_buffers: &mut UserBufferIterator<'_>,
        socket_type: SocketType,
        flags: SocketMessageFlags,
    ) -> Result<MessageReadInfo, Errno> {
        let info = if socket_type == SocketType::Stream {
            if flags.contains(SocketMessageFlags::PEEK) {
                return error!(ENOSYS);
            } else {
                self.messages.read_stream(task, user_buffers)?
            }
        } else {
            if flags.contains(SocketMessageFlags::PEEK) {
                self.messages.peek_datagram(task, user_buffers)?
            } else {
                self.messages.read_datagram(task, user_buffers)?
            }
        };
        if info.bytes_read == 0 && user_buffers.remaining() > 0 && !self.messages.is_closed() {
            return error!(EAGAIN);
        }
        if info.bytes_read > 0 {
            self.waiters.notify_events(FdEvents::POLLOUT);
        }

        Ok(info)
    }
/// Reads the the contents of this socket into `UserBufferIterator`.
///
/// Will stop reading if a message with ancillary data is encountered (after the message with
/// ancillary data has been read).
///
/// # Parameters
/// - `task`: The task to read memory from.
/// - `user_buffers`: The `UserBufferIterator` to write the data to.
///
/// Returns the number of bytes that were read into the buffer, and any ancillary data that was
/// read from the socket.
Reads the the contents of this socket into `UserBufferIterator`.
Will stop reading if a message with ancillary data is encountered (after the message with
ancillary data has been read).
Reads the the contents of this socket into ` UserBufferIterator ` . Will stop reading if a message with ancillary data is encountered ( after the message with ancillary data has been read ) .
fn read(
        &mut self,
        task: &Task,
        user_buffers: &mut UserBufferIterator<'_>,
        socket_type: SocketType,
        flags: SocketMessageFlags,
    ) -> Result<MessageReadInfo, Errno> {
        let info = if socket_type == SocketType::Stream {
            if flags.contains(SocketMessageFlags::PEEK) {
                return error!(ENOSYS);
            } else {
                self.messages.read_stream(task, user_buffers)?
            }
        } else {
            if flags.contains(SocketMessageFlags::PEEK) {
                self.messages.peek_datagram(task, user_buffers)?
            } else {
                self.messages.read_datagram(task, user_buffers)?
            }
        };
        if info.bytes_read == 0 && user_buffers.remaining() > 0 && !self.messages.is_closed() {
            return error!(EAGAIN);
        }
        if info.bytes_read > 0 {
            self.waiters.notify_events(FdEvents::POLLOUT);
        }
        Ok(info)
    }
fn read ( & mut self , task : & Task , user_buffers : & mut UserBufferIterator < ' _ > , socket_type : SocketType , flags : SocketMessageFlags , ) -> Result < MessageReadInfo , Errno > { let info = if socket_type == SocketType :: Stream { if flags . contains ( SocketMessageFlags :: PEEK ) { return error ! ( ENOSYS ) ; } else { self . messages . read_stream ( task , user_buffers ) ? } } else { if flags . contains ( SocketMessageFlags :: PEEK ) { self . messages . peek_datagram ( task , user_buffers ) ? } else { self . messages . read_datagram ( task , user_buffers ) ? } } ; if info . bytes_read == 0 && user_buffers . remaining ( ) > 0 && ! self . messages . is_closed ( ) { return error ! ( EAGAIN ) ; } if info . bytes_read > 0 { self . waiters . notify_events ( FdEvents :: POLLOUT ) ; } Ok ( info ) }
Reads the the contents of this socket into `UserBufferIterator`.
Reads the the contents of this socket into ` UserBufferIterator ` .
&mut self
task
&Task
user_buffers
&mut UserBufferIterator<'_>
socket_type
SocketType
flags
SocketMessageFlags
&mut self
task
&Task
The task to read memory from.
The task to read memory from .
user_buffers
&mut UserBufferIterator<'_>
The `UserBufferIterator` to write the data to.

Returns the number of bytes that were read into the buffer, and any ancillary data that was
read from the socket.
The ` UserBufferIterator ` to write the data to . Returns the number of bytes that were read into the buffer and any ancillary data that was read from the socket .
socket_type
SocketType
flags
SocketMessageFlags