apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: apr_socket_recv
Date Wed, 07 Jan 2004 18:28:45 GMT
Marco Spinetti wrote:

> but I can't understand how it is useful.

One reason the API is designed that way is because in many cases where 
network apps read from a peer, there is no set number of bytes to expect 
to read; the app simply decides the maximum amount it can handle at a 
time and passes a buffer of that size to the i/o layer.

Also of benefit, even when the app knows it must read a certain number 
of bytes, is the ability to know the progress of the data transfer, 
which returning partial bytes allows.

View raw message