Consecutive http requests on 3650 throw exception
I have a midlet that makes two consecutive http requests, one in a first thread, and the second by a method call made by the first thread that spawns another thread.
The second request gave me an exception when I tested it on the 3650 (ran perfectly on the emulator), but when I inserted a 500 ms delay before starting the second thread, I did not get the exception.
Can anybody shed some light on this ?
I don't think you can make more than one concurrent connection. I guess the second connection (without adding the delay) wasn't waiting for the first connection to be finished.
How'd you add the delay? (e.g. sleep(), wait(), loop?)
I tried doing the same, but had no improvement. Then again, I'm having a polling connection and a manual connection, and I'm not sure I can 100% avoid them clashing with each other.