当前位置: 首页>>代码示例>>C++>>正文


C++ DviDevice::GetDvStack方法代码示例

本文整理汇总了C++中DviDevice::GetDvStack方法的典型用法代码示例。如果您正苦于以下问题:C++ DviDevice::GetDvStack方法的具体用法?C++ DviDevice::GetDvStack怎么用?C++ DviDevice::GetDvStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DviDevice的用法示例。


在下文中一共展示了DviDevice::GetDvStack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ref

DviProtocolUpnp::DviProtocolUpnp(DviDevice& aDevice)
    : iDevice(aDevice)
    , iDvStack(aDevice.GetDvStack())
    , iLock("DMUP")
    , iUpdateCount(0)
    , iSuppressScheduledEvents(false)
{
    SetAttribute(kAttributeKeyVersionMajor, "1");
    SetAttribute(kAttributeKeyVersionMinor, "1");
    iLock.Wait();
    iServer = &(iDvStack.ServerUpnp());
    NetworkAdapterList& adapterList = iDvStack.Env().NetworkAdapterList();
    Functor functor = MakeFunctor(*this, &DviProtocolUpnp::HandleInterfaceChange);
    iCurrentAdapterChangeListenerId = adapterList.AddCurrentChangeListener(functor);
    iSubnetListChangeListenerId = adapterList.AddSubnetListChangeListener(functor);
    std::vector<NetworkAdapter*>* subnetList = adapterList.CreateSubnetList();
    AutoNetworkAdapterRef ref(iDvStack.Env(), "DviProtocolUpnp ctor");
    const NetworkAdapter* current = ref.Adapter();
    if (current != NULL) {
        AddInterface(*current);
    }
    else {
        for (TUint i=0; i<subnetList->size(); i++) {
            NetworkAdapter* subnet = (*subnetList)[i];
            try {
                AddInterface(*subnet);
            }
            catch (NetworkError& ) {
                // some hosts may have adapters that don't support multicast
                // we can't differentiate between no support ever and transient failure
                // (typical on Windows & Mac after hibernation) so just ignore this exception
                // and trust that we'll get advertised on another interface.
                char* adapterName = subnet->FullName();
                LOG2(kTrace, kError, "DvDevice unable to use adapter %s\n", adapterName);
                delete adapterName;
            }
        }
    }
    NetworkAdapterList::DestroySubnetList(subnetList);
    iAliveTimer = new Timer(iDvStack.Env(), MakeFunctor(*this, &DviProtocolUpnp::SendAliveNotifications), "DviProtocolUpnp");
    iLock.Signal();
}
开发者ID:Jacik,项目名称:ohNet,代码行数:42,代码来源:DviProtocolUpnp.cpp

示例2: iDvStack

DviProviderSubscriptionLongPoll::DviProviderSubscriptionLongPoll(DviDevice& aDevice)
    : DvProviderOpenhomeOrgSubscriptionLongPoll1(aDevice)
    , iDvStack(aDevice.GetDvStack())
    , iPropertyUpdateCollection(iDvStack.PropertyUpdateCollection())
    , iLock("LPMX")
    , iShutdown("LPSH", 0)
    , iExit(false)
    , iClientCount(0)
{
    EnableActionSubscribe();
    EnableActionUnsubscribe();
    EnableActionRenew();
    EnableActionGetPropertyUpdates();

    iShutdown.Signal();
    iMaxClientCount = iDvStack.Env().InitParams()->DvNumServerThreads() / 2;
    ASSERT(iMaxClientCount > 0);
    UpdateReadySignal empty;
    for (TUint i=0; i<iMaxClientCount; i++) {
        iUpdateReady.push_back(empty);
    }
}
开发者ID:fuzzy01,项目名称:ohNet,代码行数:22,代码来源:DviProviderSubscriptionLongPoll.cpp


注:本文中的DviDevice::GetDvStack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。