Jesse Wilson wrote:
On Fri, Oct 23, 2009 at 6:32 AM, <odea...@apache.org> wrote:

Author: odeakin
Date: Fri Oct 23 13:32:06 2009
New Revision: 829056

URL: http://svn.apache.org/viewvc?rev=829056&view=rev
Log:
The port library hysock_connect_with_timeout() function only takes an
unsigned 32bit value as a timeout (with a maximum value of 100ms), so
passing -1 here for a blocking connect makes no sense. Instead poll the call
with 100ms timeouts for a while before throwing a ConnectException to
indicate failure.


Wouldn't it be more appropriate to just relax the constraints on
hysock_connect_with_timeout?
Sure, what would you suggest? I believe the reason the portlib function was implemented this way (only a short 100ms timeout maximum) is because on some platforms it is not possible to interrupt blocking calls, so once you go into the block there is no way to stop it for, for example, VM shutdown.

Regards,
Oliver

I doubt anyone who's wants a no-timeout call
really wants a 100 second timeout plus 1000 calls out to the network. This
wastes bandwidth, CPU, battery...


--
Oliver Deakin
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Reply via email to