Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

connection timeout problem


I want to set connection timeout for all http connection bes/mds,direct tcp,wifi.I have tried putting connectiontimeout parameter in connection string but its not working.I want to set smaller time than 2 mins for http connection.Can someone plz help me on this?



Rujuta Trivedi
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: connection timeout problem

The following information is my experience for pre OS 5.0 code.  I believe with ConnectionFactory and the OS 6.0 there are better timeout functionality, so if you are looking to run only in OS 5.0 and above, then check this out.


The connectionTimeout suffix is only supported for BES/MDS connections.  There is a way of casting your http connection as a SocketConnectionEnhanced, then setting a timeout (look at the API documentation), but I believe this only works direct TCP connections.  So basically if you are running pre OS 5.0 code, you will have to code your own Timeout processing, by say starting a Timer and having the Timer close your httpConnection if it is still running when the timeout time has passed.  Sorry.