Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net HttpClient在加载时抛出HttpRequestException_.net_Http_Dotnet Httpclient - Fatal编程技术网

.net HttpClient在加载时抛出HttpRequestException

.net HttpClient在加载时抛出HttpRequestException,.net,http,dotnet-httpclient,.net,Http,Dotnet Httpclient,我们正在测试一个.NET web应用程序(托管在IIS中),该应用程序可以与各种 服务 但是,在测试开始且负载增加一段时间后,HttpClient开始向我们抛出错误: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> Sys

我们正在测试一个.NET web应用程序(托管在IIS中),该应用程序可以与各种 服务
但是,在测试开始且负载增加一段时间后,
HttpClient
开始向我们抛出错误:

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <ip_address_here>:443
BackendClient
方法中使用它:

var response = await _httpClient.SendAsync(requestMessage);
然后在
BackendClient.dispose中处理它
这个问题只显示在负载下,我们无法在其他任何地方复制它
有人熟悉这个吗?我肯定我们错过了一些场景
我看到的唯一选择是连接一个traceListener,看看它显示了什么

var response = await _httpClient.SendAsync(requestMessage);