BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-11-2007, 02:23 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Synchronization Problem?

Please Login to Remove!

Hi, I make a SocketConnection to connect to a server to make an OTA synchronization. I did that to 8100 and when i go to the Options/Network an put the Data Services to OFF and I cannot establish the socket connection. I tried to catch the exception to display a message to the Screen. But it does not display itself. What is the problem. Here is my code:

Code:
public void run() {
    try{
      connect();
      InputStream in = socket.openInputStream();
      OutputStream out = socket.openOutputStream();
      List rdfs = init(in, out, dataBase);
      dataBase = sync(in, out, rdfs, dataBase);
      socket.close();     
    } catch (IllegalArgumentException e) {
      Dialog.alert("1");
    } catch (ConnectionNotFoundException e) {
      Dialog.alert("2");
    } catch (ControlledAccessException e) {
      Dialog.alert("The connection can not be set!");
    } catch (IOException e) {
      Dialog.alert("The connection can not be found!");
    } catch(Exception e) {
    }
    synchronized(monitor) {
      isRunning = false;
    }
  }

  private void connect() throws IOException, ControlledAccessException {
    socket = (SocketConnection) Connector.open(link);
    socket.setSocketOption(SocketConnection.KEEPALIVE, 0);
    socket.setSocketOption(SocketConnection.LINGER, timeout);
  }
Offline  
Old 09-12-2007, 02:43 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found out where is the problem. When the Data Services is off, the synchronization can not be made and the Connector.open() throws an exception (IOException). It is caught but when a new thread (not the main thread) is started, Dialog.alert() can not show the dialog box on the screen so I could not understand why the exception is not caught. That was the problem . Thank you for the attention!
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

Samsung MLT-D116L 3.0K High Yield Toner For SL-M2825DW, SL-M2875FD/FW, Black
$55.26
 Samsung MLT-D116L 3.0K High Yield Toner For SL-M2825DW, SL-M2875FD/FW, Black pictureSamsung Falcon iDCS 14B - Add On Module + Plate, Screws, and data cable 28D 18D
$39.99
Samsung Falcon iDCS 14B -  Add On Module + Plate, Screws, and data cable 28D 18D pictureSamsung iDCS KDBF Full Duplex Speakerphone Module KPDF28B1FD/XAR
$39.99
Samsung iDCS KDBF Full Duplex Speakerphone Module KPDF28B1FD/XAR pictureSAMSUNG iDCS STAND FOR iDCS 18D, 28D, 18D FALCON, AND 28D FALCON PHONES
$24.99
SAMSUNG iDCS STAND FOR iDCS 18D, 28D, 18D FALCON, AND 28D FALCON PHONES pictureSAMSUNG K6X0808C1DGF55 FNFP K6X0808C1DGF55
$7.88
SAMSUNG K6X0808C1DGF55 FNFP K6X0808C1DGF55 picture






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