You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Simon Roberts <si...@fifthweb.net> on 2003/02/28 02:26:53 UTC

Re: DO NOT REPLY [Bug 17487] - waitForResponse is using busy wait

------- Additional Comments From jsdever@apache.org  2003-02-27
22:27 -------
> The patch applied is a good solution to the problem.  No extra threads are
> created and the polling loop is slowed down greatly by blocking the
current
> thread in 50ms intervals.

Maybe I'm missing something, but since the InputStream in question comes
from a Socket (via socket.getInputStream()), why can't we just set the
timeout
on the socket, and do a blocking read?

http://java.sun.com/products/jdk/1.2/docs/api/java/net/Socket.html#setSoTime
out(int)

Of course, we would have to save the old timeout and restore it.

Cheers, Simon