lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How to handle the passive FIN when waiting


From: inner T
Subject: Re: [lwip-users] How to handle the passive FIN when waiting
Date: Wed, 29 Apr 2009 10:00:13 +0800 (CST)

Thanks for your reply

I have tryed this, but if get passive close when lwip_recv() suspend the Client thread, it did not return zero but keep suspend at sys_arch_mbox_fetch(). 
lwip_recv() can return zero only when the connection is not established.

I have no idea how to fix this.


On Tue, 2009-04-28 at 18:35 +0800, inner T wrote:
> Hi All
>
>
>    I got a problem about handle the passive close. After connect to
> the server, I have a Client thread like this:
>
>
> // Client thread
> uint8 buff[buff_LEN];
> ......
> for(;;) {
> ......
> llen = lwip_recv( sockClient, buff, buff_LEN, 0 );  // wait for data
> if( llen ) {
> // some data recived, handle data
> }
> // do other works...

What do you do if llen is returned as zero by lwip_recv()?  This is the
way that lwip_recv() tells you that the socket has been closed.

Kieran
******************************************


好玩贺卡等你发,邮箱贺卡全新上线!
reply via email to

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