Android - HttpUrlConnection is not closing. Eventually results to SocketException

前端 未结 4 1210
我在风中等你
我在风中等你 2020-12-15 11:03

I am encountering some problems with the HttpUrlConnection in devices running Jellybean (4.1 - 4.3) wherein connections are not closed and results to a SocketException \"Too

4条回答
  •  独厮守ぢ
    2020-12-15 11:41

    I finally found a workaround. It seems that Jellybean is having an issue on "Keep-Alive" connections. I just added Connection=Close to my request header and now all is working. Doing a netstat, I see that the connections are now being closed and I no longer get the SocketException due to "Too many open files".

提交回复
热议问题