×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    6

    http connection throws java.io.IOException: Status=-20

    Hi all,

    I got a problem when i tried to open Input stream after opening http connection on my Actual 7650 device. The system throws java.io.IOException: Status-20 , Anyone knows workaround to solve this problem ? or Anyone successfully make http connection and open Input stream in the actual device ?

    I have tried to put the connection part into a thread and configure my wap gateway to (0.0.0.0). I am suspecting this might be http header problem.

    regards

    George

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    RE: http connection throws java.io.IOException: Status=-20

    i also had a similar problem, on first attempt to get a page from internet via GPRS, my app throws IOException : Status -2 and on the next attempt it throws IOException: Status -20019. It does works fine on the emulator, but on the real 7650 devices, what does the status code means?
    i had a deadline to meet in these few days and the app has finished and stuck in these http connection on the real devices.
    I really hope one of the technical support at Nokia can comment on this, or post a solution.

    // the code to get a webpage
    try{
    String url = "http://www.myserver.com/getString.asp?id=1";
    String ret = getViaHttpConnection(url);
    }catch(IOException e){e.printStackTrace();}

    here is the code to get a page from java.sun.com (javatips)
    -----------------------------------------------------------
    public static String getViaHttpConnection(String url)
    throws IOException
    {
    HttpConnection c = null;
    InputStream is = null;
    StringBuffer strBuffer = null;
    c = (HttpConnection)Connector.open(url);
    // Getting the InputStream will open the connection
    // and read the HTTP headers. They are stored until
    // requested.
    is = c.openInputStream();
    // Get the ContentType
    String type = c.getType();
    // Get the length and process the data
    long length = c.getLength();
    if (length > 0)
    strBuffer = new StringBuffer((int)length);
    else
    strBuffer = new StringBuffer(); // default length
    int ch;
    while ((ch = is.read()) != -1)
    {
    strBuffer.append((char)ch);
    }
    if (is != null) is.close();
    if (c != null) c.close();
    String returnStr = "";
    returnStr = strBuffer.toString();
    return returnStr;
    }

    best regards,


    Reno

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    RE: http connection throws java.io.IOException: Status=-20

    Symbian error codes: http://www.symbian.com/developer/techlib/papers/errores/Erresapi.html

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    15

    RE: http connection throws java.io.IOException: Status=-20

    I have the same problem but I can no get the error number. Can you please tell me how can I get the IO error number - the Status number?

    Thank you in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×