title: C# GetHostEntry IPV6
body: <p>I am trying to build a client/server program to transmit results of certain equations based on client input. I can get it to work no issue using 127.0.0.1, however since I am wanting to send this to clients I cannot use that. Not all clients will be on the LAN and will be transmitting over WAN. Here is a snippit of my code</p>
  
  <pre><code>            IPHostEntry ipHostInfo = Dns.GetHostEntry("127.0.0.1");
              IPAddress ipAddress = ipHostInfo.AddressList[0];
              IPEndPoint remoteEP = new IPEndPoint(ipAddress, 11000);
  
              // Create a TCP/IP socket.  
              Socket client = new Socket(ipAddress.AddressFamily,
                  SocketType.Stream, ProtocolType.Tcp);
  </code></pre>
  
  <p>I have tried using the external IPV4 address but am not even able to ping it, I can, however ping the IPV6 address and would rather use that. However when I throw in my IPV4 address the program is simply unable to connect. Any advice?</p>
  
  <p>EDIT
  Okay, So I have managed to connect them over two different LAN computers, however after sending one or two times the LAN client gives me this </p>
  
  <blockquote>
    <p>Socket Connected to 192.168.1.6:11000
    System.Net.Sockets.SocketException (0X80004005): A request to send or
    receive data was disallowed because the socket is not connected and
    (when sending on a datagram socket using a sendto call) no address was
    supplied  At System.Net.Sockets.Socket.BeginSend(Byte[] buffer, int32
    offset, int32 size, Socket Flags socketFlags, AsyncCallback callback,
    object state)  at ConsoleApp1.Form1.Send(Socket Client, String data)
    In (FileLocation) Line 111  at ConsoleApp1.Foorm1.button1_Click(Object
    sender, EventArgs e) in (FileLocation) Line 177</p>
  </blockquote>