title: Weird behaviour with sockets on localhost
body: <p>I have two .net applications communicating with sockets on port 5672 and everthing works fine. 
  On server side, i open the connection with this simple code lines:  </p>
  
  <pre><code>IPAddress localAddr = Dns.GetHostEntry("localhost").AddressList[0];  
  TcpListener socket = new TcpListener(localAddr, 5672);  
  socket.Start();  
  </code></pre>
  
  <p>If i try to launch another server app, it fails, telling me that the port is already in use.<br>
  I have also the same pair of applications writted in C++ (not by me).<br>
  To my surprise, i can launch both C++ and .net server at the same time.</p>
  
  <p>The worst is that my C++ client can´t communicate with my .net server ("connection refused"
  error). </p>
  
  <p>To understand my problem, i listed the used ports with the command:  </p>
  
  <pre><code>netstat -a  
  </code></pre>
  
  <p>And in the result i had:<br>
  TCP 0.0.0.0:5672    &lt;--- (this is the c++ server)<br>
  TCP [::1] :5672     &lt;--- (this is the .net server)</p>
  
  <p>According to my C# code, souldn't localhost address be 0.0.0.0 or 127.0.0.1?<br>
  What's happening on my .net server?<br>
  Waht's the meaning of [::1] ?  </p>
  
  <p>Note:<br>
  If i change my code to:  </p>
  
  <pre><code>IPAddress localAddr = new IPAddress(new byte[]{0,0,0,0});  
  </code></pre>
  
  <p>everything works normaly and my C++ client communicate with .net server.</p>