Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
665 Views

LWIP standalong server bug?

Hi, 

 

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? 

 

Thanks! 

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif  

Thanks!
0 Kudos
1 Reply
Highlighted
Valued Contributor III
2 Views

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  

 

http://www.sics.se/~adam/thesis.pdf (http://www.sics.se/~adam/thesis.pdf

 

I hope this answers some questions...
0 Kudos