C# Client-Server implementation error on client's socket
- by Ksice
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?