lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] exception in the second call to netconn_bind


From: David Shmelzer
Subject: Re: [lwip-users] exception in the second call to netconn_bind
Date: Thu, 5 Feb 2009 09:19:22 -0500

I converted all my code to netconn api and it works, but is a bit
slower.

If I wanted to convert it all to the raw API how do I send to the raw
API from a separate task? 
Can I safely call tcp_write from a separate task?
I noticed there's work being done on "locking" the core code to make it
thread safe. Is this safe to use yet?

Dave

> 
> 
> ------------------------------
> 
> Message: 2
> Date: Sat, 31 Jan 2009 22:16:41 +0000
> From: Jonathan Larmour <address@hidden>
> Subject: Re: [lwip-users] exception in the second call to netconn_bind
> To: Mailing list for lwIP users <address@hidden>
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> 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
> -- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]