You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Marco Spinetti <m....@pisa.iol.it> on 2004/02/16 14:28:27 UTC

[Fwd: 2 questions about apr_poll]

Can anyone give me a response?

Any kind of response.

Please help me.


Thanks, regards

--Marco



-------- Original Message --------
Subject: 	2 questions about apr_poll
Date: 	Mon, 02 Feb 2004 09:29:20 +0100
From: 	Marco Spinetti <m....@pisa.iol.it>
To: 	dev-apr <de...@apr.apache.org>



Hi all,

I developed a library which let you connect to N sources, writes a 
request and reads the responce, using apr_poll.

I have 2 questions about 2 problems I'm trying to solve.

The first is a design question: in my method I open N sockets, set the 
option APR_SO_NONBLOCK and timeout X (otherwise connect fails), connect 
them, write the request, create a pollset with the flag APR_POLLIN for 
each entry and then I call apr_pollset_poll.

In your opinion is it ok, or I should set the flag APR_POLLIN | 
APR_POLLOUT for each entry and then write or read when apr_pollset_poll 
retuns?

The second question is about apr_pollset_poll timeout.

I set the option APR_SO_NONBLOCK (I want no blocking IO): in this way 
apr_pollset_poll returns when only a part of the output from socket Y is 
ready. So I'm inside a while and I call apr_pollset_poll untill all the 
output of all sockets is ready or timeut expires.

Is the timeout of apr_pollset_poll  global, or each time I call 
apr_pollset_poll it starts again?

If it starts each time, how can I make it global with APR_SO_NONBLOCK 
socket?


Thanks


Regards


--Marco








Re: [Fwd: 2 questions about apr_poll]

Posted by Bill Stoddard <bi...@wstoddard.com>.
Marco Spinetti wrote:

> Can anyone give me a response?
> 
> Any kind of response.
> 
> Please help me.
> 
> 
> Thanks, regards
> 
> --Marco

I don't think anyone has actually tried to use the pollset API to implement anything useful (I'd be happy to 
hear othereise). I know a few of us are interested in doing some event driven non-blocking network i/o 
enhancements to Apache 2.1 and a few patches have been posted in the past but not much has been done because 
folks are just too darn busy on other things. Sorry I can't jump in and help you out here, I'd really like to.

Bill