I want to have a http connection in my J2ME application using Lwuit which will have a timeout, can manually stop the request with a button, and a loading dialog while it is processing. I tried thread for HTTP connection but even when I try to interrupt the thread, the connection is still running.Can anyone help me with a example ?
Asked
Active
Viewed 531 times
2 Answers
3
There is no way to stop an HTTP connection in MIDP. LWUIT4IO provides an API to kill a connection via the kill method which effectively just discards the thread and closes the IO streams it is using. There is a timeout flag in MIDP but it doesn't always work and there is no indication of when the timeout should elapse.
See LWUIT's see this, I don't have a sample of killing but there are several samples of using LWUIT4IO.

Shai Almog
- 51,749
- 5
- 35
- 65
-
i tried of closing HTTP connection and IO stream ,but it was still running – aNi Sep 22 '11 at 08:18
-
Did you use the kill method like I mentioned? – Shai Almog Sep 25 '11 at 04:02
0
What about the STOP
Command variable ? Look at the Javadoc about it.