本帖最后由 顾磊磊 于 2013-6-13 22:27 编辑
套接字聊天室中,设置接听队列有什么意义,不设置有什么影响?
下面是部分代码:- Socket socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- IPAddress address = IPAddress.Parse("192.168.0.9");
- IPEndPoint endpoint = new IPEndPoint(address, 50001);
- socketWatch.Bind(endpoint);
- //设置监听队列的长度
- socketWatch.Listen(10);
- Socket sokConnection = socketWatch.Accept();
复制代码 |