Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid https post - exception
    primarykey
    data
    text
    <p>i have developed a application which will post data to server using https. Code works well on devices, now suddenly I'm getting <em>java.net.SocketException : The operation timed out</em> in few devices.</p> <p>Following is my Code.</p> <pre><code>public void connectMe() { httpClient = new DefaultHttpClient(); HttpConnectionParams .setConnectionTimeout(httpClient.getParams(), 25000); HttpConnectionParams.setSoTimeout(httpClient.getParams(), 25000); try { HttpResponse response = null; switch (method) { case GET: response = httpClient.execute(new HttpGet(url)); break; case POST: try { HttpPost httpPost = new HttpPost(url); UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity( params, HTTP.UTF_8); httpPost.setEntity(p_entity); response = httpClient.execute(httpPost); } catch (Exception e) { e.printStackTrace(); } break; } } catch (Exception e) { e.printStackTrace(); } } </code></pre> <p>Following is the logcat info</p> <pre><code>W/System.err( 3593): java.net.SocketException: The operation timed out W/System.err( 3593): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method) W/System.err( 3593): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocket(OSNetworkSystem.java:130) W/System.err( 3593): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:246) W/System.err( 3593): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533) W/System.err( 3593): at java.net.Socket.connect(Socket.java:1074) W/System.err( 3593): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119) W/System.err( 3593): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:153) W/System.err( 3593): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) W/System.err( 3593): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) W/System.err( 3593): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348) W/System.err( 3593): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) W/System.err( 3593): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) W/System.err( 3593): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) W/System.err( 3593): at com.envision.utils.MyHttpConnection.connectMe(MyHttpConnection.java:128) </code></pre> <p>i uninstall and reinstalled the application, did't work out got same exception. But after doing factory data reset, above code works in the same mobile and same network.</p> <p>can anyone please explain me what is happening..? i'm confused.. </p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload