From b7346db932707f146739f249d748abba929260dd Mon Sep 17 00:00:00 2001 From: Anthony Grondin <104731965+AnthonyGrondin@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:39:53 -0400 Subject: [PATCH] docs: Document safety about socket count for embassy --- edge-nal-embassy/src/tcp.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/edge-nal-embassy/src/tcp.rs b/edge-nal-embassy/src/tcp.rs index cd38241..5900e9a 100644 --- a/edge-nal-embassy/src/tcp.rs +++ b/edge-nal-embassy/src/tcp.rs @@ -23,6 +23,12 @@ impl<'d, D: Driver, const N: usize, const TX_SZ: usize, const RX_SZ: usize> Tcp<'d, D, N, TX_SZ, RX_SZ> { /// Create a new `Tcp` instance for the provided Embassy networking stack, using the provided TCP buffers + /// + /// # Safety + /// + /// Ensure that the number of buffers `N` fits within StackResources of + /// [embassy_net::Stack], while taking into account the sockets used for DHCP, DNS, etc. else + /// [smoltcp::iface::SocketSet] will panic with `adding a socket to a full SocketSet`. pub fn new(stack: &'d Stack, buffers: &'d TcpBuffers) -> Self { Self { stack, buffers } }