You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that the guidance is to create SinchClient as a singleton (see "With ASP.NET dependency injection") the HttpClient instance created if one is not specified via options.HttpClient or one that is captured by setting options.HttpClient in the singleton factory delegate will not obtain DNS updates and high throughput could exhaust the OS limit of available ports.
Replace options.HttpClient with options.HttpClientFactory and create and dispose HttpClient instances from the factory as needed.
The text was updated successfully, but these errors were encountered:
thegrahamking
changed the title
[Feedback] HtttpClient usage does not follow best practice
[Feedback] HttpClient usage does not follow best practice
Jan 11, 2024
Given that the guidance is to create
SinchClient
as a singleton (see "With ASP.NET dependency injection") theHttpClient
instance created if one is not specified viaoptions.HttpClient
or one that is captured by settingoptions.HttpClient
in the singleton factory delegate will not obtain DNS updates and high throughput could exhaust the OS limit of available ports.See
Suggestion
Replace
options.HttpClient
withoptions.HttpClientFactory
and create and disposeHttpClient
instances from the factory as needed.The text was updated successfully, but these errors were encountered: