after executing one method, say GET, you can read the HttpStatus response number to decide whether to call the .releaseConnection () method.
Or, if you know which connection you want to close, you can try
MultiThreadedHTTPConnectionManager void releaseConnection(HttpConnection conn)
Well, I thought you had a reason why you want to “kill” the connection. Suppose you have a connection, the HttpConnection object that you want to close. Can this method help?
HttpConnection public void close() Closes the socket and streams.
source share