Again some news.In order to be understanding, I'll explain again my
problem ( and my idea of why this timeout appears ).
My application contains a service witch connects a websocket ( socket
on port 80 ) and waits "push notification".
Activities needs to send some HTTP request. So I think I have to use a
ThreadSafeClientConnManager.
Sometimes, HTTP request from activities doesn't respond and I have a
"SocketException : Connection Timed Out", and I don't really know why.

I'm asking if it can be because the websocket block others HTTP
request (but why not all of them?!).
Every idea is good to hear !
Thanks in advance ( and sorry for english mistakes! )

On Jan 13, 5:57 pm, lou <[email protected]> wrote:
> In fact, it already happens when not in wifi, but really less often...
> I'm hopeless :(
>
> On Jan 11, 11:40 am, lou <[email protected]> wrote:
>
>
>
>
>
>
>
> > New info, I think the timeout is only when I'm connected with Wifi,
> > not in 3G or edge !
> > Is it possible ? What can I do ?
> > Thanks.
>
> > On Jan 7, 6:33 pm, lou <[email protected]> wrote:
>
> > > Thanks for your answer,
> > > And yes, I've already tried to modify these parameters, but I think it
> > > don't change anything, even when the server really don't respond.
> > > So...another idea?
>
> > > On Jan 7, 6:09 pm, ivan <[email protected]> wrote:
>
> > > > 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

Reply via email to