Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Should fully consume the InputStream of InputStreamResponseListener before close it?

Hi guys,

I kinda see this pattern frequently in Apache HttpClient
Please note that if response content is not fully consumed the underlying connection cannot be safely re-used and will be shut down and discarded by the connection manager. 

Wondering it will be the same pattern need to apply when uses InputStreamResponseListener? Based on Javadoc 
If the consumer is faster than the producer, then the consumer will block with the typical InputStream.read() semantic. If the consumer is slower than the producer, then the producer will block until the client consumes
So I kinda assume that close() without fully consume the InputStream will be better (since producer doesn't need to put more data into the stream). Is that true?

Thanks!
------
Cao Mạnh Đạt

Back to the top