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...

Reply With Quote

