GWT serversided threads
I'm using the GWT RPC calls to talk to another server. I do this asynchronous by using threads. So the RPC service is returning before all threads are finished.
My problem now is that the HttpURLConnection I use, works fine when I use it woutjout thread, but crashes when I use it in a seperate thread. The reason for that I is (I think) beache the RPC call is returning before al threads are finished.
Did anybody 开发者_如何学运维had the same problem and found a solution for it?
best regards, Stefan
If your assumption that the crash is being caused by the RPC call returning too soon, you could use Thread.join()
on each of the threads you created to work asynchronously. This will block the main thread until all your background work is done.
精彩评论