lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] socket & select: can i use select with socket in listen


From: Jonathan Larmour
Subject: Re: [lwip-users] socket & select: can i use select with socket in listen mode?
Date: Mon, 10 Mar 2008 12:12:15 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Piero 74 wrote:
> 
> I read in BSD socket application note, that i can use select to manage
> IO form multiple sockets, using timeout, so, without blocking calls.
> 
> The example shows this idea:
> 
> 1. create tcp socket in listen mode
> 2. use select with sd of this socket to wait new connection using
> timeout and loop.
> 3. if new connection is available, accept it using new socket, set
> select for wait both new connection from the first socket and data from
> second, without block.
> 
> this idea allows to wait data from connected socket and wait new
> connections withou block in accept call.

Yes this is meant to work.

> i saw that option FIONBIO in lwip doesn't have effect in accept call,

Correct.

> so, this idea could be usefull for non-blocking io with listen socket

Indeed if you already know there's a pending connection (because select has
returned with that fd marked readable), then accept will not block.

> Do you know if lwip implementation of select allows this idea?

Yes.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
 **  Visit us at ESC Silicon Valley <http://www.embedded.com/esc/sv>  **
 **  April 15-17 2008, Booth 3012, San Jose McEnery Convention Center **
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

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