Is there anything special that needs to be done to make HTTP calls inside a new thread? I spent a few hours trying to fix a simple application that launches a new thread using RThread, sets up cleanup stack support, installs an active scheduler, and then tries to do an HTTP POST using code copied almost entirely from the HTTPExampleClient example app. In the main thread of the application it works perfectly, but in the threaded version it produces a KERN-EXEC 0 at the call to CActiveScheduler::Start() just after calling SubmitL() on the RHTTPTransaction object. Are there any limitations on using the HTTP API outside the application thread?


This was so obvious in hindsight! I had my RConnection and RSocketServ objects declared as static members of the class containing the threaded function and was calling RSocketServ::Connect and RConnection::Open from the new thread, but of course the objects were being created in the main thread before the other thread was launched. I changed them to local variables in the threaded function and now it all works. I knew KERN-EXEC 0 could be caused by something like that but just overlooked the location of those R-objects somehow. Won't make that mistake again in a hurry...

