scuzzy has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way one can tell can_read to return non-blocking sockets, as opposed to the default blocking when no timout is given.

Replies are listed 'Best First'.
Re: Select functions
by jasonk (Parson) on Mar 12, 2003 at 15:04 UTC

    I think you are confused here, the timeout given is how long before can_read times out, if it times out it returns an empty list. The sockets that are returned are simply the sockets that IO::Select was setup with, how you call can_read has no impact on whether those are non-blocking sockets or not, if IO::Select was given non-blocking sockets, then can_read will give you non-blocking sockets.


    We're not surrounded, we're in a target-rich environment!