lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Bug on recv_udp function?


From: Piero 74
Subject: Re: [lwip-users] Bug on recv_udp function?
Date: Thu, 25 Sep 2008 12:50:27 +0200

Hi
I have an implementation like yours... but i have some problem with select (i lost some packets)
Can you post here a piece of code about your use of select in a single task with multiple udp sockets?

Tanks you in advise!!!
Regards
Piero


2008/9/24 Muhamad Ikhwan Ismail <address@hidden>

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

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


reply via email to

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