简体   繁体   English

EWS间歇性“无法连接到远程服务器”-99%的时间正常工作

[英]EWS intermittent “Unable to connect to the remote server” - Works 99% of the time

I have ac# app that exports data from the database to the user's Exchange Calendar, using Microsoft.Exchange.WebServices (15.0.0.0). 我有一个ac#应用程序,使用Microsoft.Exchange.WebServices(15.0.0.0)将数据从数据库导出到用户的Exchange日历。 My app is DotNet 4.5.2 and I use Visual Studio 2013. 我的应用程序是DotNet 4.5.2,我使用Visual Studio 2013。

The app has been working fine for a year, and even now works 95% of the time. 该应用程序已经运行了一年,现在甚至可以在95%的时间内运行。 The app runs constantly on machine that I am logged into and monitor. 该应用程序在我登录并监控的计算机上持续运行。 This is a low volume process, perhaps 50 items get exported per day at most. 这是一个小批量的过程,每天最多可能导出50个项目。

Every couple of days, the program will give this error: "The request failed. Unable to connect to the remote server" when the app is attempting to create an EWS connection to the server. 每隔两天,该应用程序尝试创建与服务器的EWS连接时,程序都会给出以下错误消息:“请求失败。无法连接到远程服务器”。

It will do this for maybe 10-20 items. 它将执行大约10-20个项目。 So I shut it down, run it again, and it works perfectly fine on all the records that failed before. 因此,我关闭了它,然后再次运行,它在以前所有失败的记录上都可以正常工作。

This is my first EWS app, but I've been programming 30+ years and do have somewhat little knowledge of internet based apps. 这是我的第一个EWS应用程序,但是我已经编程30多年了,对基于Internet的应用程序的了解却很少。

Any helpful information or suggestions would be greatly appreciated! 任何有用的信息或建议,将不胜感激! Thank you kind people! 谢谢善良的人们!

The internet often works, but should never be considered reliable. 互联网通常可以运行,但永远不应被认为是可靠的。 Anything using it should handle errors, and retry if desired. 任何使用它的东西都应该处理错误,并在需要时重试。 The classic approach is Exponential backoff . 经典方法是指数补偿 Its possible something nasty is going on, like your ISP swapped your IP address, or just intermittent failure. 可能发生了令人讨厌的事情,例如您的ISP交换了您的IP地址,或者只是间歇性故障。 I don't know anything EWS specific, but there may also be sources of flaky issues there as well. 我不知道EWS的具体信息,但是那里也可能存在一些不稳定的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM