How to disconnect an HttpUrlConnection on HTC (Froyo and below) phones?
问题 I need to disconnect a long polling http request from the client side in some cases. The relevant part of the HttpUrlConnection I make to the server is as follows (all the code below is within a Thread's run() method): try { URL url = new URL(requestURL); connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty("Accept-Charset", "UTF-8"); connection.setConnectTimeout(5 * 1000); connection.setReadTimeout(60 * 1000); connection.setRequestMethod("GET"); // read the