取消请求会降低网络速度
Cancelled requests reduce network speed
当我取消 HTTPClient 请求时,比如在停止调试时,连接似乎挂在某处并减慢了我的整个网络。它似乎不会在一两次后发生,但多次这样做会减慢我网络上所有设备的速度。我找到的唯一解决方法是重置我的路由器。
using (HttpClient client = new HttpClient())
{
var response = client.GetAsync(uri).Result;
if (response.IsSuccessStatusCode)
{
var responseContent = response.Content;
var responseString = responseContent.ReadAsStreamAsync();
//stopped debugging here
}
}
如何手动或以编程方式找到并关闭这些连接?
This link帮了大忙。似乎很多人 运行 都遇到过这个问题,并发现启动 Fiddler 可以解决它。它还提供了很多关于该问题的附加信息。
当我取消 HTTPClient 请求时,比如在停止调试时,连接似乎挂在某处并减慢了我的整个网络。它似乎不会在一两次后发生,但多次这样做会减慢我网络上所有设备的速度。我找到的唯一解决方法是重置我的路由器。
using (HttpClient client = new HttpClient())
{
var response = client.GetAsync(uri).Result;
if (response.IsSuccessStatusCode)
{
var responseContent = response.Content;
var responseString = responseContent.ReadAsStreamAsync();
//stopped debugging here
}
}
如何手动或以编程方式找到并关闭这些连接?
This link帮了大忙。似乎很多人 运行 都遇到过这个问题,并发现启动 Fiddler 可以解决它。它还提供了很多关于该问题的附加信息。