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
rihan007
Posts: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

Does blackberry OS framework do http connection reuse?

Does blackberry framework use connection reuse for http connection? I use connectionFactory.getConnection("api.abc.com") . I have noticed that the first call (simple rest call for ex, getting number of unread messages) from my app takes about 4 seconds but all the subsequent calls take less than a second to complete. I have noticed that the same call when made after another call takes less than a second, so I am thinking that blackberry uses http connection reuse. Does anyone have an explanation for this behaviour?

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Does blackberry OS framework do http connection reuse?

I don't believe so.

 

I think the "subsequent" effect you are seeing is a result of the caching of connection setup processing.  For example, I have seen connector open() calls take ages attempting DNS lookups to confirm the URL, which are only going to be required once in a while.

Please use plain text.
Developer
rihan007
Posts: 455
Registered: ‎01-14-2009
My Device: Apple iPhone 3GS 16GB

Re: Does blackberry OS framework do http connection reuse?

hi peter_strange.

 

that makes sense. 

 

Is there any documentation you are aware of that is available which explains what caching is done during connections?

Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: Does blackberry OS framework do http connection reuse?

None that I am aware off.  For example, it is only with experience that I have figured out that https connections are actuallymade at open time, whereas http connections are only made when you request some input from the connection (e.g. response code). 

 

But in most cases this has not effected the way that I written the apps. 

Please use plain text.