ConnectionNotFoundException

Not sure if this is the correct thread, but will start here.

I am getting an error on a Symbol MC70 with an HttpConnection. The program works correctly in getting data as needed. But if I let the scanner sit and it goes into sleep mode, when I activate it again, and try to scan and it does another HttpConnection, when it does the flush to the remote service, I get the ConnectionNotFoundException 10065.

If I exit my app, then restart it, it works correctly.

Here is a sample code loop

HttpConnection con =

(HttpConnection) Connector.open("[service]");

con.setRequestMethod("POST");

OutputStream os = con.openOutputStream();

String req =new String("[parms]");

con.setRequestProperty("Content-Length",

Integer.toString(req.length()));

os.write(req.getBytes());

os.flush();

os.close();

This works each time I scan and do the post, but if I let the scanner fall asleep, then try it, it gets the Exception on the os.flush() instruction.

Any ideas?

[1179 byte] By [darinka] at [2007-11-27 7:44:14]
# 1
Well how come u be so much assured that u r getting that exception on os.flush() ?
find_suvro@SDNa at 2007-7-12 19:24:53 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Since I don't seem to be able to get line numbers in my stack trace print, I incrementally put a try catch around each line until I found where it was blowing up.Thanks,
darinka at 2007-7-12 19:24:53 > top of Java-index,Java Mobility Forums,Java ME Technologies...