David Shmelzer wrote:
Thanks for pointing me to the example in lwIP.pdf

I copied the example from the lwIP.pdf verbatim into a test function
that I execute twice. The second time through I get an exception in
netconn_bind().

The exception occurs in the first 'for' loop in tcp_bind(). The cause of the exception is cpcb->next ends up as 0x00000400 instead
of NULL.

  for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;
      cpcb != NULL; cpcb = cpcb->next) {

That's as far as I've debugged for now.
Any ideas as to where I should look next?

I am using the raw API as well as the netconn API. Is this allowed?

I expect the way you're using it... no. The lwIP core code is not thread-safe. If you are using the netconn API and the raw API together, you would have to make sure your raw API stuff happens in the context of the lwIP tcpip thread so stuff can only happen in that thread's context. You could probably use the tcpip_init_done callback (the one passed in to tcpip_init()) to set up your own callbacks for that sort of thing.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to