lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Bug: lwip_read with timeout


From: Alain Mouette
Subject: [lwip-users] Bug: lwip_read with timeout
Date: Tue, 28 Jul 2009 18:56:41 -0300
User-agent: Thunderbird 2.0.0.17 (X11/20080914)

I am using lwip 1.3.0. I want to check this before reporting to bugtracker... maybe it is already fixed.

If I set I timeout for the socket, and then read even if there is no data available, it returns 0 but I can never send anything anymore using that socket:

millis=10;
lwip_setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &millis, sizeof(millis));
...
if ((len=lwip_read(sd,msgBuf, sizeof(msgBuf))>0)
  process_new_data()
else
  do_nothing()


If i do it using select to make sure that I will never read if no data is available, it works fine:

fd_set rfds;
FD_ZERO(&rfds);
FD_SET(sd,&rfds);
tv.tv_sec=0;tv.tv_usec=0;
lwip_select(sd+1,&rfds,NULL,NULL,&tv);
if (FD_ISSET(sd,&rfds))
  if ((len=lwip_read(sock,msgBuf, sizeof(msgBuf)))>0)
    process_new_data()


I looks like a really bad bug to me... correct me please :)

thanks,
Alain




reply via email to

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