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

Kor*_*ius 8 c# http-error system.net.webexception system.net.httpwebrequest

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

这些没有帮助:

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;
Run Code Online (Sandbox Code Playgroud)

任何人有任何其他想法?

编辑:

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

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

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

usr*_*usr 8

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

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

ServicePointManager.DefaultConnectionLimit = 1000;
Run Code Online (Sandbox Code Playgroud)