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


C++ CpiSubscription::ServiceType方法代码示例

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


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

示例1: Unsubscribe

void CpiDeviceUpnp::Unsubscribe(CpiSubscription& aSubscription, const Brx& aSid)
{
    Uri uri;
    GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
    EventUpnp eventUpnp(iDevice->GetCpStack(), aSubscription);
    eventUpnp.Unsubscribe(uri, aSid);
}
开发者ID:DoomHammer,项目名称:ohNet,代码行数:7,代码来源:CpiDeviceUpnp.cpp

示例2: Subscribe

TUint CpiDeviceDv::Subscribe(CpiSubscription& aSubscription, const OpenHome::Uri& /*aSubscriber*/)
{
    Brh sid;
    iDeviceDv.CreateSid(sid);
    Brn tmp(sid);
    Brh transfer(tmp);
    aSubscription.SetSid(transfer);
    TUint durationSecs = iDeviceCp->GetCpStack().Env().InitParams()->SubscriptionDurationSecs();
    DviSubscription* subscriptionDv = new DviSubscription(iDeviceDv.GetDvStack(), iDeviceDv, *this, NULL, sid);
    subscriptionDv->AddRef(); // guard against subscription expiring before client tries to renew or unsubscribe
    iDeviceDv.GetDvStack().SubscriptionManager().AddSubscription(*subscriptionDv);
    subscriptionDv->SetDuration(durationSecs);

    iLock.Wait();
    if (iSubscriptions.size() == 0) {
        iShutdownSem.Wait(); // consume shutdown signal now the map is non-empty
    }
    Brn sid2(subscriptionDv->Sid());
    Subscription* subscription = new Subscription(aSubscription, subscriptionDv);
    iSubscriptions.insert(std::pair<Brn,Subscription*>(sid2, subscription));
    iDeviceCp->AddRef();
    iLock.Signal();

    DviService* service = iDeviceDv.ServiceReference(aSubscription.ServiceType());
    ASSERT(service != NULL);
    service->AddSubscription(subscriptionDv);
    service->RemoveRef();

    return durationSecs;
}
开发者ID:Montellese,项目名称:ohNet,代码行数:30,代码来源:CpiDeviceDv.cpp

示例3: Renew

TUint CpiDeviceUpnp::Renew(CpiSubscription& aSubscription)
{
    TUint durationSecs = iDevice->GetCpStack().Env().InitParams()->SubscriptionDurationSecs();
    Uri uri;
    GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
    EventUpnp eventUpnp(iDevice->GetCpStack(), aSubscription);
    eventUpnp.RenewSubscription(uri, durationSecs);
    return durationSecs;
}
开发者ID:DoomHammer,项目名称:ohNet,代码行数:9,代码来源:CpiDeviceUpnp.cpp

示例4: Renew

TUint CpiDeviceUpnp::Renew(CpiSubscription& aSubscription)
{
    TUint durationSecs = 30 * 60; // 30 minutes
    Uri uri;
    GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
    EventUpnp eventUpnp(aSubscription);
    eventUpnp.RenewSubscription(uri, durationSecs);
    return durationSecs;
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:9,代码来源:CpiDeviceUpnp.cpp

示例5: Subscribe

TUint CpiDeviceUpnp::Subscribe(CpiSubscription& aSubscription, const Uri& aSubscriber)
{
    TUint durationSecs = CpiSubscription::kDefaultDurationSecs;
    Uri uri;
    GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
    EventUpnp eventUpnp(aSubscription);
    eventUpnp.Subscribe(uri, aSubscriber, durationSecs);
    return durationSecs;
}
开发者ID:wifigeek,项目名称:ohNet,代码行数:9,代码来源:CpiDeviceUpnp.cpp

示例6: Subscribe

TUint CpiDeviceUpnp::Subscribe(CpiSubscription& aSubscription, const Uri& aSubscriber)
{
    TUint durationSecs = iDevice->GetCpStack().Env().InitParams().SubscriptionDurationSecs();
    Uri uri;
    GetServiceUri(uri, "eventSubURL", aSubscription.ServiceType());
    EventUpnp eventUpnp(iDevice->GetCpStack(), aSubscription);
    eventUpnp.Subscribe(uri, aSubscriber, durationSecs);
    return durationSecs;
}
开发者ID:ACDN,项目名称:ohNet,代码行数:9,代码来源:CpiDeviceUpnp.cpp

示例7: Unsubscribe

void CpiDeviceLpec::Unsubscribe(CpiSubscription& aSubscription, const Brx& /*aSid*/)
{
    AutoMutex a(iLock);
    iWriteBuffer->Write(Lpec::kMethodUnsubscribe);
    iWriteBuffer->Write(' ');
    iWriteBuffer->Write(iLpecName);
    iWriteBuffer->Write('/');
    iWriteBuffer->Write(aSubscription.ServiceType().Name());
    iWriteBuffer->Write(Lpec::kMsgTerminator);
    iWriteBuffer->WriteFlush();

    // no great benefit in waiting for a response
}
开发者ID:Jacik,项目名称:ohNet,代码行数:13,代码来源:CpiDeviceLpec.cpp

示例8: Unsubscribe

void CpiDeviceDv::Unsubscribe(CpiSubscription& aSubscription, const Brx& aSid)
{
    iLock.Wait();
    Brn sid(aSid);
    SubscriptionMap::iterator it = iSubscriptions.find(sid);
    if (it == iSubscriptions.end()) {
        iLock.Signal();
        return;
    }
    Subscription* subscription = it->second;
    iLock.Signal();
    DviService* service = iDeviceDv.ServiceReference(aSubscription.ServiceType());
    if (service != NULL) {
        service->RemoveSubscription(aSid);
        service->RemoveRef();
    }
    subscription->iCp = NULL;
    subscription->iDv->RemoveRef();
    // can't safely access subscription now - RemoveRef() above may have resulted in it being deleted
}
开发者ID:Montellese,项目名称:ohNet,代码行数:20,代码来源:CpiDeviceDv.cpp

示例9: Subscribe

TUint CpiDeviceLpec::Subscribe(CpiSubscription& aSubscription, const OpenHome::Uri& /*aSubscriber*/)
{
    Semaphore sem("CLS2", 0);
    SubscriptionResponse resp(sem);
    AutoMutex a(iLock);
    iResponseHandler = &resp;
    iWriteBuffer->Write(Lpec::kMethodSubscribe);
    iWriteBuffer->Write(' ');
    iWriteBuffer->Write(iLpecName);
    iWriteBuffer->Write('/');
    iWriteBuffer->Write(aSubscription.ServiceType().Name());
    iWriteBuffer->Write(Lpec::kMsgTerminator);
    iWriteBuffer->WriteFlush();

    sem.Wait();
    Bws<128> sid(iDevice->Udn());
    sid.Append('-');
    sid.Append(resp.SidFragment());
    Brh sid2(sid);
    aSubscription.SetSid(sid2);

    iResponseHandler = NULL;
    return UINT_MAX; // subscription never expires so report the longest possible duration
}
开发者ID:Jacik,项目名称:ohNet,代码行数:24,代码来源:CpiDeviceLpec.cpp


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