请求已中止:请求已被取消。无解的作品 [英] The request was aborted: The request was canceled. No solution works

查看:2868
本文介绍了请求已中止:请求已被取消。无解的作品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的控制台应用程序正在数百WebRequests的Facebook的每分钟(使用多个应用程序和数百个访问令牌的)。现在,他们开始失败,并在标题中的异常消息(请求已中止:请求已被取消)。我们搜索了在互联网上的时间,并试图每可能的解决方案,但没有任何帮助。

Our console applications are making hundreds of WebRequests to Facebook every minute (with using multiple apps and hundreds of access tokens). Now, they started to fail with the exception message in the title ("The request was aborted: The request was canceled"). We searched for hours on the internet, and tried out every possible solution, but nothing helped.

这些并没有帮助:

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;



任何人有任何其他的想法?

Anyone has any other idea?

编辑:

异常的ToString:System.Net.WebException:请求是
中止:请求已被取消。 ---> System.Net.WebException:在
的请求在
System.Net.ServicePointManager.FindServicePoint取消(URI地址,IWebProxy
代理,ProxyChain&安培;链,HttpAbortDelegate&安培; abortDelegate,的Int32&放大器在System.Net.HttpWebRequest
除外);
abortState)在System.Net.HttpWebRequest.FindServicePoint(布尔
forceFind)在
System.Net.HttpWebRequest.DoSubmitRequestProcessing(异常和放大器.SetResponse(例外E)--- $ b内部异常堆栈跟踪的$ b端---在
System.Net.HttpWebRequest.GetResponse()在引发WebException消息:
请求被中止:本。请求已被取消

ToString of the Exception: System.Net.WebException: The request was aborted: The request was canceled. ---> System.Net.WebException: The request was canceled at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy, ProxyChain& chain, HttpAbortDelegate& abortDelegate, Int32& abortState) at System.Net.HttpWebRequest.FindServicePoint(Boolean forceFind) at System.Net.HttpWebRequest.DoSubmitRequestProcessing(Exception& exception) at System.Net.HttpWebRequest.SetResponse(Exception E) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at WebException message: The request was aborted: The request was canceled.

EDIT2:我们还未达到极限。我们知道这种情况发生时,
,问题是不是。我们一直在这样做了两年,
和这件事情只有在整个期间发生了两次。每
的accessToken我们只是做2-3请求/分钟,并在Facebook上节流
为600请求/的accessToken / IP。

edit2: And we are NOT reaching the limit. We know when that happens, and the problem is NOT that. We have been doing this for two years, and this thing only happened twice during the whole time. Per AccessToken we are only doing 2-3 requests/minute, and the throttling on Facebook is 600 requests/accesstoken/ip.

EDIT3 :我想补充一个额外的小费谁拥有这种或类似问题的人:请确保您处置您的RequestStream,你的反应和你ResponseStream对象

edit3: I would like to add an extra tip for people who have this or similar problem: Make sure that you dispose your RequestStream, your Response and your ResponseStream object.

推荐答案

http://www.dotnetframework.org/default.aspx/4@0/4@0/untmp/DEVDIV_TFS/Dev10 /发布/ RTMRel / NDP / FX / src目录/网络/系统/网络/ ServicePointManager @ CS / 1305376 / ServicePointManager @ CS

我能看到的异常。你有没有尝试增加HTTP请求限制? ,默认为2每秒

I can see where the exception is thrown. Did you try increasing the HTTP request limit? The default is 2 per seconds.

ServicePointManager.DefaultConnectionLimit = 1000;

这篇关于请求已中止:请求已被取消。无解的作品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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