コード例 #1
0
void DeviceListTI::Poll()
{
    Timer timer(iEnv, MakeFunctor(*this, &DeviceListTI::TimerExpired));
    FunctorAsync callback = MakeFunctorAsync(*this, &DeviceListTI::GetProtocolInfoComplete);
    Brh tmp;
    const TUint count = (TUint)iList.size();
    for (TUint i=0; i<count; i++) {
        CpDevice* device = iList[i];
        TUint countBefore = gActionCount;
        Print("Device ");
        Print(device->Udn());
        iConnMgr = new CpProxyUpnpOrgConnectionManager1(*device);
        ASSERT(iConnMgr->Version() > 0);
        iStopTimeMs = Os::TimeInMs(iEnv.OsCtx()) + kDevicePollMs;
        timer.FireIn(kDevicePollMs);
        for (TUint j=0; j<iEnv.InitParams()->NumActionInvokerThreads(); j++) {
            iConnMgr->BeginGetProtocolInfo(callback);
        }
        iPollStop.Wait();
        Print("    %u\n", gActionCount - countBefore);
        delete iConnMgr;
        iExpectedSink.TransferTo(tmp);
    }
}