EWS推送订阅,如何知道何时到期?

2024-06-17 12:25:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用python订阅EWS的日历事件推送通知。https://msdn.microsoft.com/en-us/library/office/dd636171(v=exchg.80).aspx

当你在google上做同样的事情时,你会在第一个请求中得到一个“expires”日期,这样你就知道何时需要更新订阅。在

如何知道EWS订阅将于何时到期以便我可以续订?在


Tags: httpscomgooglelibrary事件事情microsoften
1条回答
网友
1楼 · 发布于 2024-06-17 12:25:14

推送通知没有真正的超时属性。Exchange推送通知的工作方式略有不同,如time-out section in the documentation所暗示的:

If the server does not receive a response to a push notification or status ping, it retries sending the notification several times before it stops sending the notifications.

所以你不需要订阅固定的时间。只要您响应服务器并确认收到通知,就会收到通知。当您停止向每个推送通知发送status pings时,服务器将停止向您发送通知。在

可以在初始订阅请求中使用StatusFrequency-元素指定Exchange服务器应重试多少次并向您请求status ping。您只需指定在放弃和停止向您发送通知之前,服务器应向您请求确认的分钟数。在

Webdav101's article on the topic真的很好,他说当订阅因某种原因停止时,您需要一些备用代码。如果您已经有一段时间没有收到通知,那么只需发布一个新的推送订阅就可以解决这个问题。在

相关问题 更多 >