BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-14-2009, 02:54 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Https thread problem

Please Login to Remove!

Hi

I have a thread which calls a https url and retrievs data after a specified period of time. I have started the thread in the alternate entry so that even if the device is rebooted the thread starts runnnig up (setting the app as device module and startup on reboot).
The app works works fine when i open up the app the thread runs, i kept the network covrage to OFF and put it ON again it still runs.

But once i close the simulator and on startup of the simulator i keep the network coverage to OFF, then the thread runs but the data is not retrieved from the server .

I have the httpGet method as under:

Code:
public String httpRequest(String url) throws IOException 
    {
        System.out.println(url);
        String result = null;
        HttpsConnection conn = null;
        InputStream input = null;    
        try 
        {
            if( url != null && url.trim().length() > 0)
            {
                conn = (HttpsConnection)Connector.open(url+";EndToEndDesired");
                System.out.println("Conn response "+ conn.getResponseMessage()); 
                if(conn.getResponseCode() == HttpsConnection.HTTP_OK)
                {
                    input = conn.openInputStream();
                    byte[] data = new byte[256];
                    int len = 0;
                    StringBuffer raw = new StringBuffer();
                    while(-1 != (len = input.read(data))) 
                    {
                        raw.append(new String(data, 0, len));
                    }
                    result = raw.toString(); 
                }
            }
            
        } catch(IOException e) {
            System.out.println(e.toString());
            throw e;
        } finally {
             try
             {
                 if(input != null) 
                 {
                    input.close();
                 }
            } catch (IOException e){}
            try
            {
                if (conn != null) 
                {
                    conn.close();
                }
            } catch (IOException e){}           
        }
        System.out.println(result);
        return result;
    }
The statement
Code:
 conn = (HttpsConnection)Connector.open(url+";EndToEndDesired");
                System.out.println("Conn response "+ conn.getResponseMessage());
Never returns anything. Does anyone have any idea.

Thanks
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

Lot of 6 CISCO CP-7945G Unified VOIP IP Telephone WORKING
$164.99
Lot of 6 CISCO CP-7945G Unified VOIP IP Telephone WORKING   pictureOpen Box Panasonic KX-HDV230b Business VoIP Desk Phone POE/AC Power SIP HDV 230
$24.95
Open Box Panasonic KX-HDV230b Business VoIP Desk Phone POE/AC Power SIP HDV 230 pictureCISCO 7960 7960G VOIP IP Telephone Gray WORKING
$27.99
CISCO 7960 7960G VOIP IP Telephone Gray WORKING   pictureNEC DT700 Series ITL-32D-1(BK)TEL Model ILV(XD)Z-Y(BK) VoIP Desktop Phone
$299.99
NEC DT700 Series ITL-32D-1(BK)TEL Model ILV(XD)Z-Y(BK) VoIP Desktop Phone pictureRCA 25630RE1 10-Line 10-Button VoIP Phone *NEW*
$161.99
RCA 25630RE1 10-Line 10-Button VoIP Phone *NEW* picture






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