×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    1

    Invalid emulator implementation?

    I use the following code:
    [pre]
    con = (HttpConnection) Connector.open("url");
    con.setRequestMethod(HttpConnection.POST);
    con.setRequestProperty("Content-Length", len);
    out = con.openOutputStream();
    // ...
    out.write(data);
    out.flush();
    // ...
    [/pre]

    When the emulator (Nokia 3300) makes flush() everything dies off, until the server breaks the connection in the result of time-out. Sun Emulator makes this code ok. Nokia 5100 emulator acts differently. It doesn’t die off but swallows part of sent data. I didn’t try other emulators. Unfortunately I didn’t test it on a real phone.


    What can be the problem?

    PS. I tested it on series 60 emulator. It's work fine, but I have strange delays before requests...
    Last edited by nektodron; 2003-09-03 at 15:17.

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    3
    It seems to me that you should not use the line:

    con.setRequestProperty("Content-Length", len);

    HttpConnection protocol class makes it by itself inside its connect() method that is called from some other methods, including out.flush().

Posting Permissions

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