Socket.Listen的参数是做什么用的?
Socket.Listen的参数是做什么用的?看了半天也没看懂。。这个值一般设置多少?
// create the socket Socket listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // bind the listening socket to the port IPAddress hostIP = (Dns.Resolve(IPAddress.Any.ToString())).AddressList[0]; IPEndPoint ep = new IPEndPoint(hostIP, port); listenSocket.Bind(ep); // start listening listenSocket.Listen(backlog);考虑默认值为5明显应该是MaxConnections 。