pub fn response<'a, W5500: Udp>(
        &self,
        w5500: &'a mut W5500,
        buf: &'a mut [u8],
    ) -> Result<Response<'a, W5500>, Error<W5500::Error>> {
        let mut reader: UdpReader<W5500> = w5500.udp_reader(self.sn)?;

        let mut dns_header_buf = Header::new_buf();
        let n: u16 = reader.read(&mut dns_header_buf)?;
        if n != Header::LEN {
            reader.done()?;
            return Err(Error::WouldBlock);
        }

        let header: Header = dns_header_buf.into();

        if header.qr() != Qr::Response {
            reader.done()?;
            return Err(Error::WouldBlock);
        }

        // ignore all the questions
        for _ in 0..header.qdcount() {
            // seek over labels
            read_labels(&mut reader, &mut [])?;

            // seek over type and class
            reader.seek(SeekFrom::Current(4))?;
        }

        Ok(Response {
            reader,
            header,
            buf,
            rr_idx: 0,
        })
    }
/// Retrieve MDNS broadcast traffic.
///
/// The nature of MDNS is such that traffic unrelated to
/// any query made on this client can appear here.
///
/// # Arguments
///
/// * `w5500`: The W5500 device that implements the [`Udp`] trait.
/// * `buf`: A buffer for reading the hostname.
///   Hostnames can be up to 255 bytes.
///
/// # Errors
///
/// This method can only return:
///
/// * [`Error::Other`]
/// * [`Error::UnexpectedEof`]
/// * [`Error::WouldBlock`]
Retrieve MDNS broadcast traffic.
The nature of MDNS is such that traffic unrelated to
any query made on this client can appear here.
Retrieve MDNS broadcast traffic . The nature of MDNS is such that traffic unrelated to any query made on this client can appear here .
pub fn response<'a, W5500: Udp>(
        &self,
        w5500: &'a mut W5500,
        buf: &'a mut [u8],
    ) -> Result<Response<'a, W5500>, Error<W5500::Error>> {
        let mut reader: UdpReader<W5500> = w5500.udp_reader(self.sn)?;
        let mut dns_header_buf = Header::new_buf();
        let n: u16 = reader.read(&mut dns_header_buf)?;
        if n != Header::LEN {
            reader.done()?;
            return Err(Error::WouldBlock);
        }
        let header: Header = dns_header_buf.into();
        if header.qr() != Qr::Response {
            reader.done()?;
            return Err(Error::WouldBlock);
        }
        // ignore all the questions
        for _ in 0..header.qdcount() {
            // seek over labels
            read_labels(&mut reader, &mut [])?;
            // seek over type and class
            reader.seek(SeekFrom::Current(4))?;
        }
        Ok(Response {
            reader,
            header,
            buf,
            rr_idx: 0,
        })
    }
pub fn response < ' a , W5500 : Udp > ( & self , w5500 : & ' a mut W5500 , buf : & ' a mut [ u8 ] , ) -> Result < Response < ' a , W5500 > , Error < W5500 :: Error > > { let mut reader : UdpReader < W5500 > = w5500 . udp_reader ( self . sn ) ? ; let mut dns_header_buf = Header :: new_buf ( ) ; let n : u16 = reader . read ( & mut dns_header_buf ) ? ; if n != Header :: LEN { reader . done ( ) ? ; return Err ( Error :: WouldBlock ) ; } let header : Header = dns_header_buf . into ( ) ; if header . qr ( ) != Qr :: Response { reader . done ( ) ? ; return Err ( Error :: WouldBlock ) ; } // ignore all the questions for _ in 0 .. header . qdcount ( ) { // seek over labels read_labels ( & mut reader , & mut [ ] ) ? ; // seek over type and class reader . seek ( SeekFrom :: Current ( 4 ) ) ? ; } Ok ( Response { reader , header , buf , rr_idx : 0 , } ) }
Retrieve MDNS broadcast traffic.
Retrieve MDNS broadcast traffic .
&self
w5500
&'a mut W5500
buf
&'a mut [u8]
&self
w5500
&'a mut W5500
buf
&'a mut [u8]
errors
This method can only return.


This method can only return .