develooper Front page | perl.perl5.porters | Postings from April 2001

Re: Not possible to set zero second timeout on accept() in IO::Socket and company..

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
April 30, 2001 06:25
Subject:
Re: Not possible to set zero second timeout on accept() in IO::Socket and company..
Message ID:
20010430082539.E16638@chaos.wustl.edu
> It is not possible to set a zero second timeout for accepts() in order to do
> a pure poll on a IO::Socket. Should the code checking to see if a timeout
> has been set be:

(sorry for the long delay in answering)

Well, I now added the capability to do a "poll" with the accept()
and connect() -- but I'm doing it only in the spirit of TIMTOWTDI,
the principle of least surpise, and consistency with select(),
because you really shouldn't be doing that:

+The timeout in the [PKG] can be specified as zero to effect a "poll",
+but you shouldn't do that because a new IO::Select object will be
+created behind the scenes just do to the single poll.  This is
+horrendously inefficient.  Use rather true select() with a zero
+timeout on the handle, or non-blocking IO.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About