Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.net.SocketException:recvfrom失败:使用移动数据时发生EconReset(由对等方重置连接)_Java_Android_Httprequest_Apache Httpclient 4.x_Cellular Network - Fatal编程技术网

java.net.SocketException:recvfrom失败:使用移动数据时发生EconReset(由对等方重置连接)

java.net.SocketException:recvfrom失败:使用移动数据时发生EconReset(由对等方重置连接),java,android,httprequest,apache-httpclient-4.x,cellular-network,Java,Android,Httprequest,Apache Httpclient 4.x,Cellular Network,我有一个android应用程序,它使用http请求通过服务器与blow lines进行通信 HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setSoTimeout(httpParams, time_out); HttpClient httpclient = new DefaultHttpClient(httpParams); ((AbstractHttpClient) httpclient).setHttp

我有一个android应用程序,它使用http请求通过服务器与blow lines进行通信

HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setSoTimeout(httpParams, time_out);
HttpClient httpclient = new DefaultHttpClient(httpParams);
((AbstractHttpClient) httpclient).setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(num_retries, true));
try {
    StringEntity se = null;
    try {
        se = new StringEntity(params.toString(), "UTF-8");
        se.setContentType("application/json; charset=UTF-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    HttpPost httpPost = new HttpPost(uri);
    httpPost.setEntity(se);
    HttpResponse response = httpclient.execute(httpPost);
    HttpEntity resEntity = response.getEntity();
}
当我使用wifi发送http请求时,一切正常,我会得到响应。但是,当我使用蜂窝移动数据时,它会打断行
HttpResponse response=httpclient.execute(httpPost)并给出以下错误:

java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)