摘抄一段m$的kb
The WinSock listen() call backlog parameter under Windows NT version 3.5 and 3.51 accepts a maximum value of 100.
The maximum backlog parameter is 5 on Windows NT 4.0 Workstation, and 200 on Windows NT 4.0 Server.
WinSock server applications use the listen() call to establish a socket for listening for incoming connections. This calls second parameter, backlog, is defined as the maximum length to which the queue of pending connections may grow.
The WinSock version 1.1 specification states the maximum value for the backlog parameter is 5. However, Windows NT version 3.5 accepts up to 100 for this value.
Services that handle a large number of socket connections may be written to use a larger backlog value to prevent client connection requests from being dropped. This can be useful when writing applications such as World Wide WEB (WWW) and gopher servers.
在Unix Network Programming V1, 3rd中也有一段类似的原话: Historically, sample code always shows a backlog of 5.
放到现在来看,并发数为5实在是太小了一点
不过有一点实在想不通,按照OO的思想来看,底层kernel堆栈这种规定队列大小的细节,怎么会在listen这个普通的函数里完成呢?厄,实在是费解... 而且还是在这样一个貌似实例方法中.......更是匪夷所思了
突然想起来,Unix Net.. 还有一段文字:... for a given listening socket, the kernel maintains two queues ... 所以实际上应该就是一个“实例”的方法