hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From natl <mister_...@yahoo.com>
Subject HttpClient write timeout
Date Sat, 11 Apr 2015 05:58:43 GMT
As mentioned in
http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/201206.mbox/%3C1339619106.2755.17.camel@ubuntu%3E,
I understand that HttpClient does not have write timeout. However, I ran
into a situation when I upload a large file to a bad written service where
if it cannot read the data with a specific time, it will write the response
back to the client with 408 timeout. However, it will stop reading more data
from the client. This causes Entity.writeTo(OutputStream) to get stuck even
though the response has been received. I wonder whether there is any good
workaround to this one apart from interrupting the thread based on the the
content length. I'd rather prefer the mechanism similar to
socket.setSoTimeout() where the call will fail as soon as a write cannot be
completed within a specific timeframe. 

One thing I notice is that SocketOutputStream.write / SocketInputStream.read
cannot be interrupted. So even though you have another thread waiting for
timeout and then trying to interrupt the thread, you won't be able to do so
with Socket API. 

Thanks, 



--
View this message in context: http://httpcomponents.10934.n7.nabble.com/HttpClient-write-timeout-tp26011.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message