I'm writing an app that does frequent HTTP requests. On the 7650 I've encountered a problem with the app freezing after a while when trying to make a connection. This always happens when I call HttpConnection.getResponseCode(), which shifts the connection into the "connected" mode. I want the MIDlet to throw some kind of time out Exception if it spends too much time on this method. I tried using Connector.open(url,Connector.READ,true) for this, but it isn't helping.
Is there anyway to achieve this timeout, because write now the app just freezes, and there is nothing I can do about it. With a timeout exception I could at least handle the error somehow.
Nothing but a nasty workaround. I can set up my own time out by letting another thread see if it takes too long and then cancel manually. The main problem is that cancelling manually usually screws up the networking, and the only solution is that the user manually disconnect (by pressing the end button), and then try again.