BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-20-2010, 11:05 PM   #1 (permalink)
New Member
 
Join Date: Oct 2009
Model: 8820
PIN: N/A
Carrier: abc
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Blocking operation-How to fix?

Please Login to Remove!

When i debug my program on device. I see the debug window informed that "blocking operation not permitted on event dispatch thread". And this exception thrown from this line in my code "streamConnection = (StreamConnection)Connector.open(getEndPoint(endPo int, WIFI));".

And this is getEndPoint code :

Code:
private static String getEndPoint(String endPoint, int connectionType){
                String s;
                switch (connectionType) {
                        case WIFI:
                                s = endPoint + ";interface=wifi";
                                break;
                        default:
                                s = endPoint;// + ";deviceside = true";
                                break;
                }
                
                return s;
        }
Offline  
Old 01-21-2010, 08:36 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

It is the Connector.open() that is causing the issue. THis needs to be done in a worker thread.

If you perform a blocking operation (like this) in the event thread, your event queue will overflow, causing the OS to dump your program as "non-responsive".
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

COPELAND SOLENOID COIL 24V, P/N-023-0060-18
$9.0
COPELAND SOLENOID COIL 24V, P/N-023-0060-18 pictureSQUARE D 8501C016V14 NEW IN BOX DPST 30A 24VAC COIL GEN PURPOSE RELAY #B35
$48.0
SQUARE D 8501C016V14 NEW IN BOX DPST 30A 24VAC COIL GEN PURPOSE RELAY #B35 pictureOmron H5CN-AN Timer Relay 12-48 VDC Coil H5CNAN
$59.99
Omron H5CN-AN Timer Relay 12-48 VDC Coil H5CNAN pictureALLEN BRADLEY AC RELAY TYPE NM LATCH TYPE 120V COIL, 700-NM400A1
$14.95
ALLEN BRADLEY AC RELAY TYPE NM LATCH TYPE 120V COIL, 700-NM400A1 pictureCleveland - KE50121-1 12-Coil Kettle Springs (2)
$19.99
Cleveland - KE50121-1  12-Coil  Kettle Springs (2) picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.