Hello Everybody!

I need some help regarding HTTP connection using WiFi technology in TungstenC PalmOS environment. I built my MIDlet that is supposed to connect to HTTP server to get some data. I deployed it to my TungstenC PalmOS device and everything works fine:-) Except for one situation: when there is no WiFi hotspot around my MIDlet starts establishing connection and after searching for connection for some time (about 20 seconds) it blocks everything and I have to reset my device to get control back:-(

I build my MIDlet in accordance with those guidelines related to blocking operations and so my connecting method executes in a separate thread, other then the main thread. I also specify Connector.open(someURL, READ_WRITE, true) , presumably providing for timeout to function properly.

On the other hand I found the following note in WebSphere Studio Device Developer V5.6 Product Documentation:
<<"Multithreaded Applications.

The Java language includes support for multiple threads. Because Palm OS does not truly support threads in user applications, a "green threads" layer is used for thread support. The VM will cause context switches to occur periodically while the VM is executing byte codes.

Programmers must be careful with any APIs that may block. If an API blocks, then the entire VM will be blocked, even other threads. To avoid blocking, programmers should specify a short time-out period and Thread.yield() before retrying the API.">>

Apparently that is something that relates to my problem :-(

Is there any hope for me to overcome my problem and make my MIDlet give me control back when connection attempt would timeout? What is exactly the meaning of the phrase: "To avoid blocking, programmers should specify a short time-out period and Thread.yield() before retrying the API." How to specify time-out period? In the Connector.open method there are only three parameters: URL (String), method(int READ, WRITE, READ_WRITE), and timeout (Boolean false, true). So what to do?

Can anybody help me? Thank you in advance

Regards,

Krzysztof Krajewski