本文整理汇总了C++中IDvInvocation::Error方法的典型用法代码示例。如果您正苦于以下问题:C++ IDvInvocation::Error方法的具体用法?C++ IDvInvocation::Error怎么用?C++ IDvInvocation::Error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDvInvocation
的用法示例。
在下文中一共展示了IDvInvocation::Error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartGetPropertyUpdates
void DviProviderSubscriptionLongPoll::StartGetPropertyUpdates(IDvInvocation& aInvocation)
{
AutoMutex a(iLock);
if (iExit) {
aInvocation.Error(501, Brx::Empty());
}
if (iClientCount == iMaxClientCount) {
aInvocation.Error(kErrorCodeTooManyRequests, kErrorDescTooManyRequests);
}
if (iClientCount == 0) {
iShutdown.Wait();
}
iClientCount++;
}
示例2: Subscribe
void DviProviderSubscriptionLongPoll::Subscribe(IDvInvocation& aInvocation, const Brx& aClientId, const Brx& aUdn, const Brx& aService, TUint aRequestedDuration,
IDvInvocationResponseString& aSid, IDvInvocationResponseUint& aDuration)
{
if (aRequestedDuration > kTimeoutLongPollSecs) {
aRequestedDuration = kTimeoutLongPollSecs;
}
DviDevice* device = iDvStack.DeviceMap().Find(aUdn);
if (device == NULL) {
aInvocation.Error(kErrorCodeBadDevice, kErrorDescBadDevice);
}
DviService* service = NULL;
const TUint serviceCount = device->ServiceCount();
for (TUint i=0; i<serviceCount; i++) {
DviService* s = &device->Service(i);
if (s->ServiceType().PathUpnp() == aService) {
service = s;
break;
}
}
if (service == NULL) {
aInvocation.Error(kErrorCodeBadService, kErrorDescBadService);
}
Brh sid;
device->CreateSid(sid);
TUint timeout = aRequestedDuration;
DviSubscription* subscription = new DviSubscription(iDvStack, *device, iPropertyUpdateCollection, NULL, sid, timeout);
aInvocation.StartResponse();
aSid.Write(subscription->Sid());
aSid.WriteFlush();
aDuration.Write(timeout);
aInvocation.EndResponse();
// Start subscription, prompting availability of the first update (covering all state variables)
iPropertyUpdateCollection.AddSubscription(aClientId, subscription);
iDvStack.SubscriptionManager().AddSubscription(*subscription);
service->AddSubscription(subscription);
}
示例3: Renew
void DviProviderSubscriptionLongPoll::Renew(IDvInvocation& aInvocation, const Brx& aSid, TUint aRequestedDuration, IDvInvocationResponseUint& aDuration)
{
DviSubscription* subscription = iDvStack.SubscriptionManager().Find(aSid);
if (subscription == NULL) {
aInvocation.Error(kErrorCodeBadSubscription, kErrorDescBadSubscription);
}
TUint timeout = aRequestedDuration;
if (timeout > kTimeoutLongPollSecs) {
timeout = kTimeoutLongPollSecs;
}
subscription->Renew(timeout);
aInvocation.StartResponse();
aDuration.Write(timeout);
aInvocation.EndResponse();
}