I'm writing a MIDlet which uses a HttpConnector wrapped up in a thread. I run it threaded so that if a connection is taking too long, the end user can click a cancel button to stop the request.
I'm having a HUGE problem with this. It seems that when a request is made via HttpConnector, it absolutely MUST be allowed to complete on a phone. To attempt to stop the connection I use the HttpConnector.Close() method, and then set the HttpConnector object and its container thread to null, but to no avail. If I try and make any other connection after doing this on the phone it fails, throwing an IOException (with no getMessage() text).
Has anyone seen this? Basically the problem is how to stop/close/cancel/terminate a HttpConnector request properly, so the phone's connection resources are fully freed up. At the moment whenever I make a request it has to be allowed complete or the phone no longer allows any other request.

Reply With Quote

