dotnet
resource_error
ai_generated
true
SocketException: Only one usage of each socket address is normally permitted
ID: dotnet/connection-pool-exhaustion
80%Fix Rate
84%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
TCP connection/port exhaustion from HttpClient misuse.
genericWorkarounds
-
95% success Use IHttpClientFactory or static HttpClient instance
-
88% success Configure SocketsHttpHandler.PooledConnectionLifetime
Dead Ends
Common approaches that don't work:
-
Create new HttpClient per request
92% fail
Root cause of port exhaustion
-
Increase ephemeral port range only
72% fail
Delays problem, doesnt fix root cause