12-12-2012 11:01 AM
When I run the LwIP echo server application through JTAG, I found a phenomenon that is: the connection can be built only several times instead of infinite. Similarilty, after you make a connection, the data can be echo several times instead of infinite. I try to find whether there is "counter" inside the code which may limit the time, but I didn't find it. If it is not caused by "counter", I guess it may be caused by "timer". Is anybody confront the similar thing like me and can explain the reason?
Thanks very much.
12-12-2012 03:58 PM
12-12-2012 07:14 PM
12-13-2012 01:39 AM
How exactly are you closing the connection ? It might be possible that your connection closing mechanism is not correct. That way your older connections are still active!
So the primary reason I suspect is that you are running out of memory as your older pcb's are not freed up correectly! I would check the debug messages. Turn on lwip statistics and the debug messages from the lwip library settings in the BSP.
Also note there is a parameter called TCP_DEFAULT_LISTEN_BACKLOG which is set to FF by default. This makes it possible to have a limited number of simultanious connections.
The connection id in the tcp_accept callback is keeping track of the number of connections accepted! that is why it is declared static.
12-13-2012 07:30 AM