Skip to main content
Graduate II
December 5, 2024
Solved

LWIP STM32F4 allocate a single udp_pcb per connected device?

  • December 5, 2024
  • 1 reply
  • 766 views

Sorry for asking an obvious question...

LWIP documentation describes a udp_pcb as "Creates a new UDP pcb which can be used for UDP communication."

https://lwip.fandom.com/wiki/Raw/UDP

When connecting to multiple devices with an IP address each using UDP protocol with LWIP, is it expected that you allocate a udp_pcb struct per connected device? Or try and re-use a single UDP protocol control block.

 

E.g. One Device connecting to 5 other devices:

therefore create five udp_pcb objects?

or 

re-use one udp_pcb but send to different IP addresses? 

 

Thanks in advance.

    This topic has been closed for replies.
    Best answer by STea

    Hello @###### ,

    I recommend that you use a udp_pcb per connection.
    Regards

    1 reply

    STeaAnswer
    ST Employee
    December 5, 2024

    Hello @###### ,

    I recommend that you use a udp_pcb per connection.
    Regards

    ######Author
    Graduate II
    December 5, 2024

    @STea

    Thanks.