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
Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

setting read timeout value for HTTP/HTTPS connection instances

Hi All

 

I would like to set the read timeout value to HttpConnection and HttpsConnection instances.  How can I do that?

 

 

I know there is something called  SocketConnectionEnhanced. But this does not support for HttpsConnection on HttpConnection instances.

 

So I would like to know are there any other ways where I can set this vulue for these instances?

 

Thanks & Best Regards,

Sudhakar Chavali

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: setting read timeout value for HTTP/HTTPS connection instances

Hi Sudhakar,

 

You can set the timeout value to HttpConnection  by appending the ConnectionTimeOut String to Connection String as :

 

HttpConnection conn = (HttpConnection)Connector.open(urlstring + ";ConnectionTimeout=10000;deviceside=true");

 

Thanks & Regards,

Kanak Sony

 

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

Re: setting read timeout value for HTTP/HTTPS connection instances

Hi kanaksony,

 

I am not talking about ConnectionTimeOut. I am talking about read time out. Moreover ConnectionTimeOut will not work for direct tcp connections.

 

Thanks & Best Regards,

Sudhakar Chavali

Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

Re: setting read timeout value for HTTP/HTTPS connection instances

Hello All,

 

Can somebody let me know how can I set a readtimeout value for HTTP/HTTPS connection instances?  Please note that I am using direct tcp connection option for connecting to http services.

 

Thanks & Best Regards,

Sudhakar Chavali

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

Re: setting read timeout value for HTTP/HTTPS connection instances

I am not aware of an official way of doing this for direct TCP, http connections.

 

However you may find that the method suggested by kanaksony does actually work, especially in later OS'es.  Give it a try. 

Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

Re: setting read timeout value for HTTP/HTTPS connection instances

I have already done with that approach and did not work for me.

 

Regards

Sudhakar Chavali