C# Client-Server implementation error on client's socket

Posted by Ksice on Stack Overflow See other posts from Stack Overflow or by Ksice
Published on 2012-06-15T15:13:32Z Indexed on 2012/06/15 15:16 UTC
Read the original article Hit count: 137

Filed under:
|

I'm trying to launch my client. Server already runned on the same computer. So I'm using "localhost" with GetHostEntry:

 IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry("localhost");
 IPAddress ipAddress = ipHostInfo.AddressList[0];
 IPEndPoint remoteEP = new IPEndPoint(ipAddress, Port);

But I have this "no connection could be made because the target machine actively refused it" error. What is the reason? Could it be because ipHostInfo.AddressList[0] is an IPv6? How then I can accept Ipv4 address?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sockets