|
From: | Muhamad Ikhwan Ismail |
Subject: | [lwip-users] Bug on recv_udp function? |
Date: | Wed, 24 Sep 2008 12:17:01 +0000 |
Hi guys. On my implementation of the lwip 1.3.0, i had a high frequency input and output of UDP packets on multiple sockets in a single task. So all the sockets read and write are done with select since none of them can be blocking. The problem was it still blocked despite select said something was in the mailbox. Select checks out the recvevent variable of the sockets, and it was 1 despite the fact nothing was available in mailbox and hence the recv call blocked. So i checked out the recv_udp() function and found this : SYS_ARCH_INC(conn->recv_avail, p->tot_len); /* Register event with callback */ API_EVENT(conn, NETCONN_EVT_RCVPLUS, p->tot_len); if (sys_mbox_trypost(conn->recvmbox, buf) != ERR_OK) { netbuf_delete(buf); return; } The problem is, if the posting failed, the recvevent variable was not subtracted hence it stayed one despite the mailbox posting failed. I only found this with high frequency packet sending. Should this be a bug ? Greetings M Ikhwan Ismail Stay up to date on your PC, the Web, and your mobile phone with Windows Live. See Now |
[Prev in Thread] | Current Thread | [Next in Thread] |