Rashmi,
I believe HttpsURLConnection will use connection pooling if you just call close(). You need to explicitly call disconnect() for the socket to be shutdown.
I have run into CLOSE_WAIT issues before and it was typically caused by error conditions that dod not result in me properly cleaning up the connection.
John
On 2016-08-02, at 5:25 PM, rpujar_at_inocybe.com wrote:
> Hi,
> Doesn't CLOSE_WAIT state mean that the server already received a FIN
> from the client and the server did not issue a close()? Could you
> please clarify why you say: make sure you are actually closing
> connections after accessing RESTful API.
>
> Also, the client being used is: Javax.net.ssl.HttpsURLConnection
>
> Thanks