Have you tried playing with the timeouts passed via the http params? HttpParams httpParameters = new BasicHttpParams(); ConnManagerParams.setMaxTotalConnections(httpParameters, inApp.gResources.getInteger(R.integer.HTTP_MaxConnCnt)); HttpConnectionParams.setConnectionTimeout(httpParameters, 20000); // Set the timeout in milliseconds until a connection is established. HttpConnectionParams.setSoTimeout(httpParameters, 30000); // Set the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data.
On Jan 7, 9:29 am, lou <[email protected]> wrote: > Hi ! > I'm actually trying to do an application with a websocket persistent > connexion & some http request. So I thank I need to use > ThreadSafeConnectionManager, but I have a big problem with it : very > very often I got a "java.net.SocketException: The operation timed out" > even when the server's responding. > My code : > // class members declarations > private static HttpParams mParams; > private static SchemeRegistry mSchemeRegistry; > private static ClientConnectionManager mCm; > private static HttpClient mClient; > > // code used to initiate the HttpClient > mParams = new BasicHttpParams(); > mSchemeRegistry = new SchemeRegistry(); > mSchemeRegistry.register(new Scheme("http", > PlainSocketFactory.getSocketFactory(), 80)); > mCm = new ThreadSafeClientConnManager(mParams, mSchemeRegistry); > mClient = new DefaultHttpClient(mCm, mParams); > > What am I doing wrong? > Thanks a lot. > Louis C. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

