Optimize AppVeyor network stack for number of dynamic connections #922
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many internet sources indicate that the root cause for
System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted.
is port exhaustion. In case of SSH.NET tests, this could be caused by a large number of connections opened and closed in quick succession. This was already discussed in #877 (comment).In this PR I have both increased the number of ports that can be used for client side connections and decreased the time that the network stack needs to wait before reusing bindings. More information on these settings here.
As this only affects the AppVeyor build VM, I do not expect any regressions or side effects.
This will (hopefully) fix #921.