diff options
| -rw-r--r-- | embassy-net/src/udp.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs index 0d97b6db1..0a5a7b8f6 100644 --- a/embassy-net/src/udp.rs +++ b/embassy-net/src/udp.rs | |||
| @@ -184,6 +184,26 @@ impl<'a> UdpSocket<'a> { | |||
| 184 | pub fn may_recv(&self) -> bool { | 184 | pub fn may_recv(&self) -> bool { |
| 185 | self.with(|s, _| s.can_recv()) | 185 | self.with(|s, _| s.can_recv()) |
| 186 | } | 186 | } |
| 187 | |||
| 188 | /// Return the maximum number packets the socket can receive. | ||
| 189 | pub fn packet_recv_capacity(&self) -> usize { | ||
| 190 | self.with(|s, _| s.packet_recv_capacity()) | ||
| 191 | } | ||
| 192 | |||
| 193 | /// Return the maximum number packets the socket can receive. | ||
| 194 | pub fn packet_send_capacity(&self) -> usize { | ||
| 195 | self.with(|s, _| s.packet_send_capacity()) | ||
| 196 | } | ||
| 197 | |||
| 198 | /// Return the maximum number of bytes inside the recv buffer. | ||
| 199 | pub fn payload_recv_capacity(&self) -> usize { | ||
| 200 | self.with(|s, _| s.payload_recv_capacity()) | ||
| 201 | } | ||
| 202 | |||
| 203 | /// Return the maximum number of bytes inside the transmit buffer. | ||
| 204 | pub fn payload_send_capacity(&self) -> usize { | ||
| 205 | self.with(|s, _| s.payload_send_capacity()) | ||
| 206 | } | ||
| 187 | } | 207 | } |
| 188 | 208 | ||
| 189 | impl Drop for UdpSocket<'_> { | 209 | impl Drop for UdpSocket<'_> { |
