×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    36

    Network Locks Out on Nokia 3650

    Firmware: V 2.54, 2-3-2003
    Network: AT&T

    Using the code from the networking example at:

    http://wireless.java.sun.com/midp/articles/network/

    (Example 3)

    Repeating the connection in a loop we see the following replicable behavior:

    1. Network requests work fine till around the 13th interation.

    2. This request tends to throw an exception. (i.e. unexpected end-of-stream encounted)

    3. We believe this exception is caused by a network timeout based on our other tests.

    4. The 14th request is then successful but the 15th request also times out.

    5. At this point we appear to have lost the ability to do any net connection as our 16th, 17th, 18th, 19th, and 20th requests all throw exceptions.

    Code Follows:

    package thirdexample;

    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;

    /**
    * An example MIDlet to invoke a CGI script.
    */

    public class ThirdExample extends MIDlet
    {
    private Display display;
    String url = "http://developer.java.sun.com/cgi-bin/getgrade.cgi?name=182016";
    private Form fForm;

    public ThirdExample()
    {
    display = Display.getDisplay(this);
    }
    /**
    * Initialization. Invoked the MIDlet is activated.
    */
    public void startApp()
    {
    fForm = new Form("Test");
    display.setCurrent(fForm);
    for (int i = 0; i < 20; i++)
    {
    fForm.append("try #" + (i + 1) + ": ");
    try
    {
    long time1 = System.currentTimeMillis();
    getGrade(url);
    long time2 = System.currentTimeMillis();

    fForm.append("(" + (time2 - time1) + " millis)\n");
    }
    catch (IOException e)
    {
    fForm.append(e.getMessage());
    e.printStackTrace();
    }
    }
    }
    /**
    * Pause, discontinue ....
    */
    public void pauseApp() { }
    /**
    * Destroy must cleanup everything.
    */
    public void destroyApp(boolean unconditional) { }
    /**
    * Retrieve a grade....
    */
    void getGrade(String url) throws IOException
    {
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    StringBuffer b = new StringBuffer();
    TextBox t = null;

    try
    {
    c = (HttpConnection) Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("IF-Modified-Since",
    "10 Nov 2000 17:29:12 GMT");
    c.setRequestProperty("User-Agent",
    "Profile/MIDP-1.0 Confirguration/CLDC-1.0");
    c.setRequestProperty("Content-Language",
    "en-CA");
    os = c.openOutputStream();

    /**
    String str = "?idnum=182016";
    byte postmsg[] = str.getBytes();
    for(int i=0;i<postmsg.length;i++) {
    os.writeByte(postmsg[i]);
    }
    os.flush();
    */

    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1)
    {
    b.append((char) ch);
    }
    //t = new TextBox("Final Grades", b.toString(), 1024, 0);
    fForm.append(b.toString());
    }
    finally
    {
    if (is != null)
    {
    is.close();
    }
    if (os != null)
    {
    os.close();
    }
    if (c != null)
    {
    c.close();
    }
    }
    //display.setCurrent(t);
    }
    }

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    36

    Verified with commerical application

    We were able to reproduce and verify this problem with the commerical product 'WebViewer" on the Nokia 3650 described in the previous message.

    http://reqwireless.com/webviewer.html

    Same behavior ... as the test. After about 10-13 "I/O requests" we get the -33 exception ... then one success ... then "no joy".

    We did this via. the "Reload Page" operation and verified that indeed ... the software was reloading the page from the browser (we created a very small HTML page with one word).

    We even alternated between two seperate URL's on the theory that the WAP Gateway was somehow the culprit ... but the behavior was identical.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    36
    Somone else has got to be seeing this?

    Please?

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    9
    I am having the same kind of problem, with my own midlets.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    Hong Kong
    Posts
    8
    I've seen the same problem before. I guess it's related to the network operator because when I switched to another operator, the problem disappears.

    Did you try another operator?

  6. #6
    Registered User
    Join Date
    Jul 2003
    Posts
    36
    It's a problem with the cWap gateway. See my other message on this.

    I just hate to have to put the users through all of this.

Posting Permissions

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