apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@gbiv.com>
Subject Re: [RFC] apr_pollcb api?
Date Mon, 20 Mar 2006 04:04:33 GMT
On Mar 19, 2006, at 10:54 AM, Paul Querna wrote:

> Roy T. Fielding wrote:
>> Also, should there be different
>> callback functions for ready read, write, and error, or just one
>> function that is responsible for all three?
>
> But, what happens when there is a socket that is being monitored  
> for all 3, do you call all 3 callbacks?

I'd guess so, if all three are set on the return from poll.  I'm just  
curious what the best design would be.  My guess is that it will  
depend on why
the poll is being done.

> The apr_pollfd_t contains a bit field which we mark with the events  
> it was triggered for.  If the user of the API wants to do different  
> callbacks for each, they can build that on top of the single callback.

Hmm.  I was thinking in terms of async i/o applications, wherein the
caller is actually a multiplexer for many handlers and the ones looking
for read events (input filters) might not be the same as those looking
for write events (output filters).  They might not even be aware of
each other. But there may be a better way to do that.

Also, I have no idea what poll is supposed to do if the array
contains the same fd more than once, or even if it is worthwhile
supporting such a thing in callbacks.

....Roy

Mime
View raw message