帮帮忙吧,socket提示说 使用了与请求的协议不兼容的地址 怎么才能是ipv4呢
具体部分代码如下:public static IPAddress GetServerIP()
{
IPHostEntry ieh = Dns.GetHostEntry(ConnDb.Ip);
return ieh.AddressList[0];
}
private void BeginListen()
{
OprateCtrl oc;
//IPAddress ServerIp = GetServerIP();
IPEndPoint iep = new IPEndPoint(Dns.GetHostEntry(ConnDb.Ip).AddressList[0], ConnDb.port);
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(iep);
oc = new OprateCtrl(OprateUI1);
BeginInvoke(oc, DateTime.Now + " " + iep + "端口已开启监听");