Welcome!

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

Reply
Contributor
Posts: 25
Registered: ‎02-19-2013
My Device: 8520
My Carrier: vodafone

request time out using HttpConnection

Hi all, 

 

I am try to give connection timeout for y app for that sample code is

 

HttpConnection con = ()Connector.open(url + ";deviceside=true;ConnectionTimeout=10000" );

 

 

when i run this app in simulator i am not getting exception ,

 

in console it shows like "Device is a simulator and USE_MDS_IN_SIMULATOR is false"

 

 

i have checked launchMobile data system connection service(MDS-CS)with simulator

 

 

can anyone tell me how to fix the issue

 

 

Regards

Vijay

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

Re: request time out using HttpConnection

Dies it work if you remove the connectionTimeout suffix? 

Contributor
Posts: 25
Registered: ‎02-19-2013
My Device: 8520
My Carrier: vodafone

Re: request time out using HttpConnection

yes, it's working fine

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

Re: request time out using HttpConnection

ConnectionTimeout is not supported for ";deviceside=true"

 

Have a look at this KB article.

http://supportforums.blackberry.com/t5/Java-Development/Control-the-connection-timeout-for-TCP-conne...

 

There are various ways of connecting, this KB article talks about them:

http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-make-an-HTTP-or-socket-con...

 

Rather than specify this yourself, I recommend that you use ConnectionFactory - review the API and there are a number of Threads that talk about it on here.

 

Finally, with respect to timing out connection, there are other Threads that talk about this - search - but I think this Thread summarizes most of the important points:

http://supportforums.blackberry.com/t5/Java-Development/Consistent-HTTP-Timeout-setting/m-p/1973759#...