If all of the Ephemeral Ports are used, and another socket tried to connect to a server, will the connection fail? or will the socket be assigned a port outside the range of the Ephemeral Ports?
-
This varies not only from sku to sku, but also from patch level to patch level. As such we can't give you a canonical answer without more information. you can see evidence of this here: en.wikipedia.org/wiki/Ephemeral_port– Frank ThomasJun 16, 2016 at 16:55
-
I find Frank's answer to be highly likely... as Microsoft strives to make things work easily/by default (just use another port) or security (don't do anything unexpected), behavior likely changed over time. However, with at least some versions of Microsoft Windows, you can customize the range of ephemeral port range, which is likely to make this relatively easy to test.– TOOGAMJun 16, 2016 at 17:48
-
1I think you will find this article helpful: blogs.technet.microsoft.com/askds/2008/10/29/…– Frank ThomasJun 17, 2016 at 12:08
1 Answer
The article mentioned in a comment by Frank Thomas indicates that everything that requires an outbound connection will fail, including Windows domain authentication.
This BizTalk troubleshooting page says that .NET applications will get one of these errors when attempting to create a connection in the face of ephemeral port exhaustion:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.
System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Though the range allocated by default to ephemeral ports does change from version to version, you will always experience connection failures when you run out of these ports.