java.net.SocketException:recvfrom失败:ECONNRESET

时间:2014-07-15 01:38:07

标签: android androidhttpclient

这个警告意味着什么?这是我的代码段的代码,

public static Bitmap downloadBitmap(String url) {
    if (reachable()) {
        HttpEntity entity = null;
        Log.i("DLB URL", url);
        HttpClient client = new DefaultHttpClient();
        HttpGet getRequest = new HttpGet(url);
        try {
            HttpResponse response = client.execute(getRequest);
            final int statusCode = response.getStatusLine().getStatusCode();
            if (statusCode != HttpStatus.SC_OK) {
                return null;
            }
            entity = response.getEntity();
            if (entity != null) {
                InputStream inputStream = null;
                try {
                    System.setProperty("http.keepAlive", "false");
                    inputStream = entity.getContent();
                    final Bitmap bitmap = BitmapFactory.decodeStream(inputStream);

                    return bitmap;

                } finally {
                    if (inputStream != null) {
                        inputStream.close();
                    }
                }
            }
        } catch (Exception e) {
            Log.i("ABORT", e.toString());
            getRequest.abort();
        }
    }
    return null;
}

警告是在decodeStream行,但我不知道这是什么。在搜索上我找到了可能的东西,但我没有工作线程,所以我不明白。谢谢。

1 个答案:

答案 0 :(得分:0)

完全没问题。只是一个警告。