Reputation: 846
How is it possible to get the dynamically assigned port of a IPEndPoint, when you create it with 0 as port:
var endpoint = new IPEndPoint(Dns.GetHostAddresses(localhost).FirstOrDefault(), 0);
If I look at the endpoint.Port, it is 0 (any), even tho the underlaying Socket must have an designated port already?
Upvotes: 1
Views: 685