|
From: | Jonathan Larmour |
Subject: | Re: [lwip-users] exception in the second call to netconn_bind |
Date: | Sat, 31 Jan 2009 22:16:41 +0000 |
User-agent: | Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515) |
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 insteadof 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
[Prev in Thread] | Current Thread | [Next in Thread] |