apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Spinetti <m.spine...@pisa.iol.it>
Subject [Fwd: 2 questions about apr_poll]
Date Mon, 16 Feb 2004 13:28:27 GMT
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.spinetti@pisa.iol.it>
To: 	dev-apr <dev@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








Mime
View raw message