超级简单问题 关于udp的socket
Listen就报错 但是不要Listen 它又说需要Listen
static void Main(string[] args)
{
IPAddress localIp = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];
Socket skt = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPEndPoint localEndPoint = new IPEndPoint(localIp,7777);
skt.Bind(localEndPoint);
skt.Listen(10);
skt.Accept();
}
------解决方案--------------------不用listen