lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Problems with TCP


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] Problems with TCP
Date: Thu, 09 Jan 2003 01:23:11 -0000

Hi!

On Thursday 07 February 2002 08.55, you wrote:
> Can someone throw some light on what is going on? BTW I did think about
> using the TCP code from shell.c but that doesnt use the Raw API and the API
> it uses (i.e. netconn_*) is not documented anywhere.

The problem is because your HandleNewConnection() function blocks on 
sys_sem_wait(). Since this function is executed in the TCP/IP thread, it must 
not block, since this will block the entire TCP/IP stack. The raw API 
requires a slight mindshift from the threaded programming model to the 
callback/event based model. 

In your case, you shouldn't wait for the semaphore. Instead, you should put 
the code that comes after sys_sem_wait() in your ReadSocket() function.

The sequential API (netconn_*) is documented in the paper found in the 
"Documentation" section on the lwIP homepage. Since programs using the 
sequential API runs in a different thread from the TCP/IP stack, there are no 
problems with blocking there.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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