aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Mabin <[email protected]>2023-08-15 15:24:58 +0100
committerScott Mabin <[email protected]>2023-08-15 15:31:23 +0100
commitc114ea024a2b74e3e220e6af1d8a494dd598b130 (patch)
tree91e75c6342941782761c5f38c58ee922865401e5
parentb1ef009c6b08ae54595ca558f4571d430e99cb0b (diff)
Add udp capacity impls
-rw-r--r--embassy-net/src/udp.rs20
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
189impl Drop for UdpSocket<'_> { 209impl Drop for UdpSocket<'_> {