Skip to main content
######
Senior II
December 5, 2024
Solved

LWIP STM32F4 allocate a single udp_pcb per connected device?

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.
STeaBest answer
ST Employee
December 5, 2024

Hello @###### ,

I recommend that you use a udp_pcb per connection.
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

2 replies

STeaBest answer
ST Employee
December 5, 2024

Hello @###### ,

I recommend that you use a udp_pcb per connection.
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
######
######Author
Senior II
December 5, 2024

@STea

Thanks.