-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Net.Http.HttpRequestException: Normally only one use of each socket address (protocol/network address/port) is allowed #109141
Comments
.net version: .net6.0 |
This looks like a symptom of port exhaustion.
Note that this is the total number of TCP ports, the number of available dynamic ports is typically 16384. Moreover, it does not limit the total number of connections, only the ones that go to the same peer. If you want to resolve this by limiting A couple of ideas:
|
Is the server you're talking to in this case your YARP configuration described in dotnet/yarp#2427? |
No, this is not the same problem. It seems that the problem is caused by the reuse of the client port when creating a connection. Today, I tried to change the registry |
Port reuse can help if you're talking to multiple different servers, it won't do anything if you're only establishing connections to a single server. Note that If you're establishing tons of connections to a single endpoint, it is expected that you may run out of available ports and observe these exceptions. |
Not sure how does the
Please let us know if any of the recommendations helped. |
I am glad to receive your reply. The project is currently migrating from .net461 to .net8.0. After the migration is completed, we will try point 4 in #109141 (comment). |
This issue has been marked |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
Scenario:
Continuously send a large number of short requests. Their request time is very short, but the number is large. They are requested through IP. The IP and port are fixed. The exception message
System.Net.Http.HttpRequestException: Normally only one use of each socket address (protocol/network address/port) is allowed
will appear from time to timeCallerClient is a global static
The text was updated successfully, but these errors were encountered: