I have the following function which returns
CallEndpoint by channel id:
static CallEndpoint* locateChan(const String& id, bool peer = false)
{
if (id.null())
return 0;
Message m("chan.locate");
m.addParam("id",id);
if (!Engine::dispatch(m))
return 0;
CallEndpoint* ce = static_cast<CallEndpoint*>(m.userObject(YATOM("CallEndpoint")));
if (!ce)
return 0;
return peer ? ce->getPeer() : ce;
}
This code is used from
ExtModReceiver::processLine as follows. And this works if external module is a pipe script, but doesn't work if it a TCP socket. I tried to debug it without success:
Engine::dispatch doesn't work.
The difference which I've found is TCP extmodule starts from an additional thread of
ExtListener which is a server for processing incoming connections (it's true approach). Can this broke
Engine::dispatch? Or may be other reasons?