개발
TCP Listen시 ipv4, ipv6 연결 가능하게 하기
준혁양
2024. 6. 8. 18:04
기존 소스코드
string host = Dns.GetHostName();
IPHostEntry ipHost = Dns.GetHostEntry(host);
IPAddress ipAddr = ipHost.AddressList[0];
IPEndPoint endPoint = new IPEndPoint(ipAddr, 7777);
변경 후 소스코드
IPEndPoint endPoint = new IPEndPoint(ipAddr, 7777);
로 변경하면 모든 ip로 접속이 가능합니다.