As David Haas points out, select() definitely does work in lwIP 1.1.0. I can also confirm that recvfrom() works correctly on a non-blocking socket. One thing to note is that lwIP expects ioctl FIONBIO's 3rd argument to be a u32_t *, not an int * (as on BSD); this might cause problems if you reuse existing socket code on lwIP with a 16-bit CPU.
-- Tim Robbins Teragen International Pty. Ltd. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Frédéric BERNON > Sent: Saturday, 3 September 2005 12:14 AM > To: Mailing list for lwIP users > Subject: [lwip-users] Non Blocking Socket ? > > Hello there, > > I try to use a SOCK_DGRAM socket in a non-blocking mode. I > would like to have a code like this : > > While(True) > if (sendto( socket, ....)>=0) > { if (recvfrom( socket...)>=0) > { do job > } > } > > My problem is that the recvfrom is block the process. So, if > the peer never answer (or if the packet is lost), the > recvfrom never returns and my process is dead. I have try > SO_RCVTIMEO option, but it seems it is not support by lwIP. I > read in the lwIP.pdf document (Adam Dunkels, Feb 20, 2001, > chapiter 17) that "select" is not supported. > > So, How can I do to do a code like this, with a timeout on recvfrom ? > > Note I use a lwIP 1.1.0 on a multithread OS. Perhaps a bug in > our sys_arch ? > > Thanks > > > ============================== > Frédéric BERNON > HYMATOM SA > Chef de projet informatique > Microsoft Certified Professional > Tél. : +33 (0)4-67-87-61-10 > Fax. : +33 (0)4-67-70-85-44 > Email : [EMAIL PROTECTED] > Web Site : http://www.hymatom.fr > ============================== > _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
