android - java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer) is occures when using mobile data -


i have android application use http request communicate through server 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(); } 

when use wifi send http request fine , i'll response. when using cellular mobile data break in line httpresponse response = httpclient.execute(httppost); , gives following error:

java.net.socketexception: recvfrom failed: econnreset (connection reset peer) 


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -