如何知道Pull订阅已过期? [英] How to know that a Pull Subscription got expired?

查看:65
本文介绍了如何知道Pull订阅已过期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PullSubscription来获取有关新邮件的通知。但是在创建它时我们还必须指定超时,如果服务器未在超时限制内轮询,则订阅将结束。

I am using PullSubscription to get the notification about new mail. But while creating it we have to specify a timeout also, the subscription will end if the server is not polled within the timeout limit.


PullSubscription < span style ="font-size:8.0pt; font-family:'Courier New'"> subscription = service.SubscribeToPullNotifications(

new FolderId [] { WellKnownFolderName .Inbox},

new FolderId[] { WellKnownFolderName.Inbox },

5 / * timeOut :如果服务器未在5分钟内轮询,则订阅将结束。 * /

null / * watermark:null以启动新订阅。 * /

null /* watermark: null to start a new subscription. */,

EventType .NewMail, EventType .Created, EventType .Deleted);

EventType.NewMail, EventType.Created, EventType.Deleted);

 

我的问题是,如果订阅过期或结束,我怎么知道它以便我可以重新开始订阅? 

My question is that, if a subscription got expired or ended, how would I know it so that I can restart the subscription? 

推荐答案

如果订阅已过期,则在为该订阅调用GetEvents时将收到错误消息。这表示您必须再次订阅。
If a subscription has expired, you will get an error message when you call GetEvents for that subscription. That will be an indication that you have to subscribe again.


这篇关于如何知道Pull订阅已过期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆