Skip to content

Commit 17cac6d

Browse files
authored
Update vulnerabilities-cbc-mode.md (#27894)
* Update vulnerabilities-cbc-mode.md [Refresh link]Replace bookmarks in repo * TASK 536167:[Refresh link]Replace bookmarks in repo * Update use-httpclientfactory-to-implement-resilient-http-requests.md * Update use-httpclientfactory-to-implement-resilient-http-requests.md Updated
1 parent ea261aa commit 17cac6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Therefore, `HttpClient` is intended to be instantiated once and reused throughou
1717

1818
Another issue that developers run into is when using a shared instance of `HttpClient` in long-running processes. In a situation where the HttpClient is instantiated as a singleton or a static object, it fails to handle the DNS changes as described in this [issue](https://github.com/dotnet/runtime/issues/18348) of the dotnet/runtime GitHub repository.
1919

20-
However, the issue isn't really with `HttpClient` per se, but with the [default constructor for HttpClient](/dotnet/api/system.net.http.httpclient.-ctor?view=netcore-3.1#System_Net_Http_HttpClient__ctor&preserve-view=false), because it creates a new concrete instance of <xref:System.Net.Http.HttpMessageHandler>, which is the one that has *sockets exhaustion* and DNS changes issues mentioned above.
20+
However, the issue isn't really with `HttpClient` per se, but with the [default constructor for HttpClient](/dotnet/api/system.net.http.httpclient.-ctor#system-net-http-httpclient-ctor), because it creates a new concrete instance of <xref:System.Net.Http.HttpMessageHandler>, which is the one that has *sockets exhaustion* and DNS changes issues mentioned above.
2121

2222
To address the issues mentioned above and to make `HttpClient` instances manageable, .NET Core 2.1 introduced the <xref:System.Net.Http.IHttpClientFactory> interface which can be used to configure and create `HttpClient` instances in an app through Dependency Injection (DI). It also provides extensions for Polly-based middleware to take advantage of delegating handlers in HttpClient.
2323

0 commit comments

Comments
 (0)