diff options
| author | chrysn <[email protected]> | 2024-04-15 10:02:35 +0200 |
|---|---|---|
| committer | chrysn <[email protected]> | 2024-04-15 10:02:35 +0200 |
| commit | 8fe88847d81afceaa55aa68662d4162d5c12f804 (patch) | |
| tree | b0c56c7a333da1ab2a7edf187e9f10e94e40d7d6 /embassy-net | |
| parent | 7f1bedcee037839c77312d5ce667f2c199b473be (diff) | |
fixup! net/udp: Relay full UdpMetadata instead of only remote endpoint in poll_ functions
Diffstat (limited to 'embassy-net')
| -rw-r--r-- | embassy-net/src/udp.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs index 2fdf83e9d..3e72327c6 100644 --- a/embassy-net/src/udp.rs +++ b/embassy-net/src/udp.rs | |||
| @@ -111,10 +111,8 @@ impl<'a> UdpSocket<'a> { | |||
| 111 | /// This method will wait until a datagram is received. | 111 | /// This method will wait until a datagram is received. |
| 112 | /// | 112 | /// |
| 113 | /// Returns the number of bytes received and the remote endpoint. | 113 | /// Returns the number of bytes received and the remote endpoint. |
| 114 | pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, IpEndpoint), RecvError> { | 114 | pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, UdpMetadata), RecvError> { |
| 115 | poll_fn(move |cx| self.poll_recv_from(buf, cx)) | 115 | poll_fn(move |cx| self.poll_recv_from(buf, cx)).await |
| 116 | .await | ||
| 117 | .map(|(size, metadata)| (size, metadata.endpoint)) | ||
| 118 | } | 116 | } |
| 119 | 117 | ||
| 120 | /// Receive a datagram. | 118 | /// Receive a datagram. |
