Showing results for 
Search instead for 
Did you mean: 
Valued Contributor III

LWIP standalong server bug?



Examining the example lwip_server, in particular httpd.c. 


When tcp_close is called the pcb is deallocated, so surely a tcp_new,bind must be performed again? 


in the LWIP source tcp.c you can see the memp_free? 


is there any good documentation for the LWIP rawapi, the little rawapi.txt file does not talk about pbuf management - such as is done within http_recv() for example? 


is the pbuf_free() necessary? and should the tcp_recved(pcb, p->tot_len) not actually be tcp_recved(pcb,p->len) ? tot_len is the sze of the buffer and all other chained ones? (or so the LWIP source comments say?) 


Are there any other examples of LWIP rawapi apps? 



0 Kudos
1 Reply
Valued Contributor III

Re: LWIP standalong server bug?

I&#39;m also trying to use the standalone LwIP Raw API in a more extensive application than the http-server example. 

I share the complaint that you made : the &#39;rawapi.txt &#39; documentation is far from complete. 


But to be maybe of a little help to you : the thesis written by Adam Dunkels (the original designer of LwIP) is available on the internet. in Chapter 4 it discusses in general how the TCP/IP stack works and you can find some more details about memory management and the use of the pbufs. 


You can find the thesis at (


I hope this answers some questions...
0 Kudos