Even with a bad network connection?
In particular, I wrote code that launches a separate thread (from the user interface) that tries to download the file via HTTP POST. However, I found that if the connection is bad, the processor is looping for outputstream.close () or httpconnection.getheaderfield () or for any read / write that forces data over the network. This not only makes the thread stuck, but also steals the entire processor, so even the user interface becomes immune.
I tried to lower the priority of the thread, but to no avail.
My theory is that there is no easy way to avoid this behavior, so the entire j2me tutorial tells developers to create a "send data over the network ..." instead of just sending everything to the background stream. If someone can prove to me that this is wrong, that would be fantastic.
Thanks!
source
share