lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] MEM_UDP_PCB usage vs MEM_TCP_PCB usage


From: stuart200471
Subject: [lwip-users] MEM_UDP_PCB usage vs MEM_TCP_PCB usage
Date: Tue, 19 Nov 2019 22:05:06 -0700 (MST)

Hello,
    I am currently running both a TCP and a UDP server on an STM32 chip. The
server takes in txt commands and sends out txt results. 
With the TCP server, I have set MEM_TCP_PCB = 10, this allows me to have 10
simultaenous TCP connections to the server. If i try to have more, the lwip
stats show errors in the MEM_TCP_PCB values.

Now, with the UDP server, I thought i would need the same... e.g.
MEM_UDP_PCB = 10. But, through experimenting, it appears that I only need to
allocate 1 UDP_PCB for the UDP server. When the UDP packet arrives, it gets
the allocated UDP_PCB, it gets sent to the udp_serv_recv() function to get
processed. After processing, a response is immediately sent back to the
client (through lwip) using the same udp_pcb. 
To test this, i created an app which had 128 individual clients all sending
requests to the server (and being responded too) and when looking at the
lwip stats, my MEM_UDP_PCB "used" value never increased and the lwip heap
stayed within limits.
Now, i am (happy) surprised that this appears to be the case...but just to
make sure, I thought i would run it past you all incase your experience is
wildly different to mine. 
So, is this the behaviour (resource usage) you would expect for the UDP
server? or, would you say I am measuring some thing incorrectly?
Thanks
Stuart



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]