In comp.os.linux.networking Rajat <(E-Mail Removed)> wrote:
> If you are agreeing that using setsockopt() we are just SIMULATING the
> socket's I/O behaviour, Then how come both of them do the SAME job
> internally.
> Like using setsockopt() with SO_RCVTIMEO, if we pass some low timeout
> value which is greater than zero(0), the socket will feel like
> non-blocking socket. If we pass zero(0) as timeout value then the
> receive timeout time will be infinite, So it will feel like blocked
> I/O. But it is not exactly the case.
First, SO_RCVTIMEO is not overly portable, so portable code cannot
rely upon it.
Second, a really small timeout will only feel like a non-blocking
socket if the stack which happens to implement the SO_RCVTIMEO does
not subscribe to the POSIXy belief that setting a timeout of N time
units means that the timeout will be _at least_ N time units and allow
a timeout of less than a tick to be no timeout at all. On those
systems that do subscribe to the belief that timout settings are for
_at least_ that length, even a timeout setting of a femtosecond

will be a timeout of one tick.
And that will be >>>>> than the time for a non-blocking socket.
rick jones
--
oxymoron n, Hummer H2 with California Save Our Coasts and Oceans plates
these opinions are mine, all mine; HP might not want them anyway...

feel free to post, OR email to raj in cup.hp.com but NOT BOTH...