I have a NaCl C program using ppapi_simple. I need to call asynchronous PPAPI functions such as PPB_NetworkMonitor::UpdateNetworkList().
When I tried implementing it naively, the callback I passed to UpdateNetworkList() was never called. Looking at the ppapi_simple source code, I noticed that ppapi_simple never calls PPB_MessageLoop::Run() on its internal message loop, which probably explains why my callback is never called.
What is the right way to use asynchronous PPAPI functions in a ppapi_simple program? Should I create my own thread and message loop?
EDIT: According to MessageLoop's documentation, it's only needed for making PPAPI calls on a thread. So I tried calling UpdateNetworkList() on the main thread using CallOnMainThread() and it does work - my callback is called. Not sure it's the best solution though.