title: Find a free port
body: <p>I'm writing an FTP server library (because I need it and I can't find any good solutions for this) in C# and I have two questions:</p>
  
  <ul>
  <li><p>How does <code>IPEndPoint</code> find a free port when I do <code>new IPEndPoint(IPAddress.Any, 0)</code>, for example? </p></li>
  <li><p>Is it possible to find a free port from a range (for example from 1023 to 65535), <strong>without</strong> the <code>GetActiveTcpConnections</code> method? Because it is slow - I need a faster way to do this.</p></li>
  </ul>