Search code examples
lwip

LWIP: When to deallocate the pbuf after calling udp_sendto(...)?


When sending a UDP packet with LWIP using the uds_sendto(...) call when do I deallocate the pbuf? Can I do this right after uds_sendto(...) or do I have to wait for the paket to actually having been sent to the network and then do this in some callback?

Regards


Solution

  • You can deallocate the pbuf immediately after calling udp_sendto, unless you're doing something fancy like Zero-Copy TX buffers