windows 2000 profession的accept 队列最多只能排5个,即如果有10个并发的客户同时提出连接请求,windows只能处理5个,其它的只能稍后再连。但是Socket的同时连接数则不只5个。 Windows 2000 server和Advanced server则不止这个数,可以在Listen函数上指定。Microsoft在professional上做了限制,好让server版本多卖点钱。
用IOCP模式管理数千个连接不成问题,具体可看msdn上的文章: Writing Windows NT Server Applications in MFC Using I/O Completion Ports
保持稳定的同时连接数目肯定远不止5个。
5个只是“同时”响应连接请求的默认值。
exitwindows 解释得不错。
Windows 2000 server和Advanced server则不止这个数,可以在Listen函数上指定。Microsoft在professional上做了限制,好让server版本多卖点钱。
Writing Windows NT Server Applications in MFC Using I/O Completion Ports
我也有类似问题,需要管理很多socket, 我考虑采用完成端口模型,但我不熟悉。
有什么好的想法,请EMAIL:[email protected]