K: You mean I need make accept socket to be non-blocking , right ? 锘?Vincent Cui Sr.Firmware Engineer Mobile: +8613482482211 Tel: +86 21 34612525x6104 Fax: +86 21 34619770 E-Mail: [email protected] Shanghai EnLogic Electric Technology Co., Ltd. Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233 http://www.enlogic.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Kieran Mansley Sent: 2011年8月30日 23:19 To: Mailing list for lwIP users Subject: Re: [lwip-users] FreeRTOS / lwip multiple connections
On Tue, 2011-08-30 at 14:04 +0000, vincent cui wrote: > Deal with mult-connection correctly, there is 3 way. There are lots of ways! > 3. Using socket, you must set it with non-blocking and select it > > I use the 3th method. The following code must be add to listen socket. > > > Int arg = 0x1; > > lwip_ioctl(listhensocket, FIONBIO, &arg); I'm not sure why you need your listening socket to be non-blocking. > but I found that the listen socket cann’t work once it is set with > nonblocking… > now, I remove it, it works … hope someone explain why I'm not sure if lwIP supports non-blocking listening sockets. I'd have to check the source to be sure and I'm short on time. > other, you also need call lwIP_shutdown and lowip_close to terminate > socket in order to be avoid to CLOSE_WAIT . No, either should be fine if you use them correctly. There are some small differences between lwIP's shutdown and close and standard shutdown and close, but we're working towards getting them more standardised where possible. Kieran _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
