Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 27398 invoked by uid 500); 2 Apr 2001 03:01:27 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 27377 invoked from network); 2 Apr 2001 03:01:24 -0000 Date: Sun, 1 Apr 2001 19:59:11 -0700 (PDT) From: X-Sender: To: Dirk-Willem van Gulik Cc: Subject: Re: apr_send() and timeout In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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 _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------