lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwip tcp hangup


From: vincent cui
Subject: Re: [lwip-users] lwip tcp hangup
Date: Thu, 1 Sep 2011 09:30:11 +0000

In fact, my understanding is same as yours ...but I don't get correct result in 
testing 

锘?Vincent Cui
Sr.Firmware Engineer
Mobile: +8613482482211
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: address@hidden
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 
200233
http://www.enlogic.com

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of FreeRTOS Info
Sent: 2011年9月1日 17:29
To: Mailing list for lwIP users
Subject: Re: [lwip-users] lwip tcp hangup

I'm trying to follow this discussion, but it is not clear to me why the
delay is required at all?

Presumably accept() will keep the task in the Blocked state (i.e. not
using any CPU time) until there is something to accept.  This is the
intended usage model when using any kernel, be it FreeRTOS or otherwise,
isn't it?

When there is something to accept, a task is created to handle the
connection (if necessary, but that could become unwieldy if there are a
*lot* of simultaneous connections), then the original task loops back
and Blocks again until there is something else to do.

Am I missing the point here - and if so - what is the point I am missing?


Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.
More than 7000 downloads per month.




On 01/09/2011 10:23, Simon Goldschmidt wrote:
> vincent cui <address@hidden> wrote:
>> while (1) 
>>      {
>>         clientfd = lwip_accept(lSocket, (struct sockaddr*)&client_addr,
>> &addrlen);
>>              if (clientfd > 0)
>>              {
>>                      xTaskCreate( httphandler, NULL, 128, (void *)&clientfd,
>> HTTP_TASK_PRIORITY, NULL );
>>                      vTaskDelay(100);
>>              }
>>              else
>>              {
>>                      lwip_close (clientfd);
>>              }
>>     }
>>
>>
>> I have added it after accept loop.... 
> 
> No, after the accept() call, but before the next accept() call in the loop, 
> so between 2 calls to accept(), you will delay.
> 
> Simon

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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