请求已中止:请求已取消。 没有解决方案

我们的控制台应用程序每分钟都会向Facebook发送数百个WebRequests(使用多个应用程序和数百个访问令牌)。 现在,他们开始失败并在标题中显示exception消息(“请求已中止:请求已取消”)。 我们在互联网上搜索了几个小时,并尝试了所有可能的解决方案,但没有任何帮助。

这些没有帮助:

webRequest.Timeout = 20000; //A request that didn't get respond within 20 seconds is unacceptable, and we would rather just retry. webRequest.KeepAlive = false; webRequest.ProtocolVersion = HttpVersion.Version10; webRequest.ServicePoint.Expect100Continue = false; 

任何人有任何其他想法?

编辑:

exception的ToString:System.Net.WebException:请求已中止:请求已取消。 —> System.Net.WebException:请求在System.Net.HttpWebRequest.FindServicePoint(Boolean forceFind)的System.Net.ServicePointManager.FindServicePoint(Uri地址,IWebProxy代理,ProxyChain&chain,HttpAbortDelegate&abortDelegate,Int32&abortState)中被取消。在System.Net.HttpWeb上的System.Net.HttpWebRequest.DoSubmitRequestProcessing(exception和exception)处(exceptionE)—内部exception堆栈跟踪结束—在WebException消息的System.Net.HttpWebRequest.GetResponse()处:请求已中止:请求已取消。

edit2:我们没有达到极限。 我们知道什么时候发生,问题不是那样。 我们已经这样做了两年,这件事在整个过程中只发生了两次。 每个AccessToken我们每分钟只做2-3次请求,Facebook上的限制是600个请求/ accesstoken / ip。

edit3:我想为有这个或类似问题的人添加一个额外的提示:确保你处理你的RequestStream,你的Response和你的ResponseStream对象。

http://www.dotnetframework.org/default.aspx/4@0/4@0/untmp/DEVDIV_TFS/Dev10/Releases/RTMRel/ndp/fx/src/Net/System/Net/ServicePointManager@cs/1305376/ ServicePointManager @ CS

我可以看到抛出exception的位置。 您是否尝试过增加HTTP请求限制? 默认值为每秒2。

 ServicePointManager.DefaultConnectionLimit = 1000;