I am trying to create an HTTP request to read the URL, and this code was working fine 15 days back, but now it\'s not working.
I had a similar issue and it turned out that it wasn't my machine closing the connection but rather the server with which I was connected was kicking me due to an error in my code that spammed the site.
For anyone who has this issue, check that you aren't doing the same thing I was. If you think it's the server, it may be that the server is trying to handle too many requests all at once, not always from the same source.
Actually, I found the answer by my own. This error was because of the k9 software, so I uninstalled it, and now there is no error regarding connection establishing. If anyone is getting this error, he/she should uninstall the software such as Skype, k9 (protocol using software) type of software.