mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-02-16 17:02:30 +00:00
fixup! net/udp: Relay full UdpMetadata instead of only remote endpoint in poll_ functions
This commit is contained in:
parent
7f1bedcee0
commit
8fe88847d8
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user