.net HttpClient在加载时抛出HttpRequestException
我们正在测试一个.NET web应用程序(托管在IIS中),该应用程序可以与各种 服务.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
但是,在测试开始且负载增加一段时间后,
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);