C
C#2y ago
Cracker

❔ How to handle DNS-IP Changes while use of static HttpClient in v4.8 ?

There is SocketsHttpHandler overload available in netcore2.1 but how do I handle dns-ip changes in framework 4.8 project ?
3 Replies
lycian
lycian2y ago
I think you'd have to listen for the ETW events on resolution, similar to this: https://www.meziantou.net/avoid-dns-issues-with-httpclient-in-dotnet.htm
Meziantou's blog
Avoid DNS issues with HttpClient in .NET - Gérald Barré
In this post, I describe how to correctly configure an HttpClient instance to avoid issues with the connection pool and DNS changes.
Cracker
CrackerOP2y ago
How about I cache the date httpclient instance is created and recreate it by controlling the date with parametric time period ? @ryzngard Looks like easier solution
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server