本文整理汇总了C++中DviSubscription::Renew方法的典型用法代码示例。如果您正苦于以下问题:C++ DviSubscription::Renew方法的具体用法?C++ DviSubscription::Renew怎么用?C++ DviSubscription::Renew使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DviSubscription
的用法示例。
在下文中一共展示了DviSubscription::Renew方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: Renew
void DviSessionUpnp::Renew()
{
LOG(kDvEvent, "Renew subscription (request): ");
LOG(kDvEvent, iHeaderSid.Sid());
LOG(kDvEvent, "for %u secs\n", iHeaderTimeout.Timeout());
if (iHeaderCallback.Received() || iHeaderNt.Received()) {
Error(HttpStatus::kBadRequest);
}
DviDevice* device;
DviService* service;
ParseRequestUri(DviProtocolUpnp::kEventUrlTail, &device, &service);
if (device == NULL || service == NULL) {
Error(HttpStatus::kPreconditionFailed);
}
DviSubscription* subscription = DviSubscriptionManager::Find(iHeaderSid.Sid());
if (subscription == NULL) {
Error(HttpStatus::kPreconditionFailed);
}
TUint duration = iHeaderTimeout.Timeout();
subscription->Renew(duration);
iResponseStarted = true;
iWriterResponse->WriteStatus(HttpStatus::kOk, Http::eHttp11);
WriteServerHeader(*iWriterResponse);
IWriterAscii& writerSid = iWriterResponse->WriteHeaderField(HeaderSid::kHeaderSid);
writerSid.Write(HeaderSid::kFieldSidPrefix);
writerSid.Write(iHeaderSid.Sid());
writerSid.WriteFlush();
IWriterAscii& writerTimeout = iWriterResponse->WriteHeaderField(HeaderTimeout::kHeaderTimeout);
writerTimeout.Write(HeaderTimeout::kFieldTimeoutPrefix);
writerTimeout.WriteUint(duration);
writerTimeout.WriteFlush();
iWriterResponse->WriteHeader(Http::kHeaderConnection, Http::kConnectionClose);
iWriterResponse->WriteFlush();
iResponseEnded = true;
LOG(kDvEvent, "Renew subscription (complete): ");
LOG(kDvEvent, iHeaderSid.Sid());
LOG(kDvEvent, "for %u secs\n", duration);
}