apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@covalent.net>
Subject Re: apr_send() and timeout
Date Mon, 02 Apr 2001 02:59:11 GMT
On Sun, 1 Apr 2001, Dirk-Willem van Gulik wrote:

> Am I right to understand that it is the designed intention of apr_send()
> to do a best efford write to the network; it retries' on EINTR and under
> certain conditions on EAGAIN/EWOULDBLOCK - but basically returns as soon
> as something is writen (even if it is not all) - and waits once up till
> Timeout if needed.

apr_send tries to send data until a given timeout pops.  It only retries
on EAGAIN/EWOULDBLOCK if we get that on the first write.  We do that,
because going into select without trying to write means that in a best
case scenario, we have an extra syscall.

> With this understanding I find that in for example AB I have to
> do things like
> _sendAll_with_timeout_or_error {
> 	while(len) {
> 		set timeout
> 		if apr_send == error
> 			return bang
> 		len-=send
> 		calculate new timeout
> 	};
> 	return ok
> }
> Is there a suitable AB function ? Should I add one - as I'd hate to fiddle
> with timeout's from outside apr.

There is no suitable function, and writing one is not possible.  Many
platforms zero out the timeout, so that we can't cleanly recalculate the
new timeout.


Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131

View raw message