fixup! net/udp: Relay full UdpMetadata instead of only remote endpoint in poll_ functions

This commit is contained in:
chrysn 2024-04-15 10:02:35 +02:00
parent 7f1bedcee0
commit 8fe88847d8

View File

@ -111,10 +111,8 @@ impl<'a> UdpSocket<'a> {
/// This method will wait until a datagram is received. /// This method will wait until a datagram is received.
/// ///
/// Returns the number of bytes received and the remote endpoint. /// Returns the number of bytes received and the remote endpoint.
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, IpEndpoint), RecvError> { pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, UdpMetadata), RecvError> {
poll_fn(move |cx| self.poll_recv_from(buf, cx)) poll_fn(move |cx| self.poll_recv_from(buf, cx)).await
.await
.map(|(size, metadata)| (size, metadata.endpoint))
} }
/// Receive a datagram. /// Receive a datagram.