HttpURLConnection error: java.net.SocketTimeoutException: Connection timed out
<p>I am using simple urlconnection like this: </p>

<pre><code>       url = URL+"getClient&amp;uid="+cl_id;
        URL url = new URL(this.url);
        Log.d("Set++","get_t URL: "+ url);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
</code></pre>

<p>its working fine, but sometimes i get this error:</p>

<pre><code>       error: java.net.SocketTimeoutException: Connection timed out
</code></pre>

<p>what could be the reason? I have only 4 clients... so i dont think that the server is overloaded with connections.</p>

<p>the code: </p>

<pre><code>    try {
        URL = Settings.BASE_URL + "_interface.php?" +
                "key=" + Settings.KEY +"&amp;app_naam="+Settings.APP_NAAM+ "&amp;action=check&amp;setTime="+c;
        URL url = new URL(URL);
        if(D)Log.e("ChekTreadAanvr+url", URL);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();

        BufferedReader rd = new BufferedReader(
                new InputStreamReader(conn.getInputStream()));
        String response;
        if ((response = rd.readLine()) != null) {
            rd.close();
        }
        if(D) Log.d("WebSaveThread+","DATARESIEVED:  "+response);
        return response;
            } catch (MalformedURLException e) {
        if(D)Log.d("ERR","server chekc failure ++ ");
        return success = false;
    } catch (IOException ioex) {
        if(D)Log.e("ERR", "error: " + ioex.getMessage(), ioex);
        success = false;
    }
    return Boolean.toString(success);
</code></pre>
