I’m using HttpClient 5.1.3 and I’m having problems with the underlying socket 
not closing. This problem only occurs if I call 
response.getEntity().getContent()

If I only call response.getEntity() the underlying socket gets closed fine.

I’ve tried doing the bare minimum of:

InputStream is = response.getEntity().getContent();
is.close();
response.close();

But even with this, the underlying socket remains open.

I’ve tried looking at the samples and I can’t see I’m doing anything different. 
What am I missing?


Gordon Ross (he/him)
Collaboration Tools Team
University Information Services
University of Cambridge

While it suits me to email outside normal working hours, I do not expect a 
response outside your own.

Reply via email to