lwip-users
[Top][All Lists]
Advanced

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

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


From: inner T
Subject: [lwip-users] How to handle the passive FIN when waiting datas
Date: Tue, 28 Apr 2009 18:35:56 +0800 (CST)

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...
......
}
......

   It works good except this problem:
   I found that lwip_recv() will suspend Client thread at sys_arch_mbox_fetch() in function netconn_recv() of api_lib.c line 347, wait the message forever. In this situation, I have no idea how to handle the passive close. The tcp_thread() have acked the first FIN, change the tcp_pcb->state to CLOSE_WAIT.

   I'm less experence in multi-threaded programing, If there is any other way to implement my Client thread, please tell me, thanks.


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

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