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
New Contributor
ro27
Posts: 8
Registered: ‎03-30-2011
My Device: Blackberry Bold 9700
My Carrier: O2

Re: Multiple HTTP operations in one program

After fiddling around I've realised the Player thread also blocks the BlackBerry browser from working. So literally there can only be one concurrent HTTP operation. any idea what could be causing this?

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

Re: Multiple HTTP operations in one program

Just as an experiment, on an OS 4.5 Simulator, I started 3 concurrent background Threads, all downloading a web page.  All successfully downloaded the page. 

 

I choose an OS 4.5 Simulator because I think OS 4.5 is the most 'restrictive' in terms of http functionality.  So if it works in OS 4.5, it should work in the SImulator that you are using. 

 

Anyway, I didn't have any problems, from which I would conclude that multiple http processing is possible, so it is something else that is 'locking' your processing and meaning that there is only one thing being run at once.

 

In the past, people have complained about this 'single tasking' on the SImulator and it has turned out to be  incorrect coding, like using <thread>.run, instead of <thread>.start,, or using invokeLater() in an inappropraite place, so that even though people thought they were running separate Threads, the code was running on the Event Thread.

 

To eliminate this in your case, can I suggest you put the following code in anything that you think should be a background Thread.  Watch out for any Dialog alerts generated.

 

if ( Application.isEventDispatchThread() ) {

Dialog.alert("running on Event Thread");

}

Please use plain text.
New Contributor
ro27
Posts: 8
Registered: ‎03-30-2011
My Device: Blackberry Bold 9700
My Carrier: O2

Re: Multiple HTTP operations in one program

It seems to be a problem with the proxy I was behind. I can't figure out quite why it was behaving like it was, but it wasn't my program in the end. It works fine on my home connection luckily. Thanks for your help. If anyone else has this problem in future, the best thing to do is try it on another connection and go from there.

Please use plain text.