apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@rkbloom.net>
Subject Re: Poll() problem
Date Sat, 05 Jun 2004 13:57:21 GMT


On Sat, 5 Jun 2004, Damir Dezeljin wrote:

> Hi.
>
>
> > What platform are you on?
> Windows :'(
>
>
> > (although I know we have solved this somehow
> > for pipes, because we must poll in mod_cgi.)
> This is a great news. I need to poll on a pipe from child process. I will
> try to checkout a recent version of apr, apr-utils and apr-iconv and try
> to recompile.

Sorry to lead you to believe this was actually fixed in APR.  It isn't.
What I meant, was that I know we can do timed reads from a pipe, because
mod_cgi in Apache does it.  However, apr_poll does not.  My initial
thought as to why we can do it from apr_file_read and not from apr_poll,
is that sockets and files are different beasts in Windows, and the API
that polls sockets can't poll files.  So, for file reads in Windows, we
use async I/O to get timeouts.

If you are polling to determine if a single pipe has data, then your best
bet is to just call apr_file_read after having set a timeout on the pipe.
If you want to poll a set of pipes to determine which to read from, you
will probably end up sitting in a tight loop trying to read from each with
a 0 timeout until one has data.

This is really bad, but it is all Windows allows us to do.

Ryan



Mime
View raw message