> > I set listen(2) and expect to see "error" when more clients than "the > maximum number of queued connections" trying to connect the server. But, no > error!! Even 4 clients can run normally without problem. > > Am I misunderstanding the meaning of this argument? >
https://docs.python.org/3/library/socket.html#socket.socket.listen: Enable a server to accept connections. If backlog is specified ... it specifies the number of unaccepted connections that the system will allow before refusing new connections. So I read that to say that the listen method will accept as many connection as it can handle, and will put into a backlog those it cannot. Your argument of 2 tells the method to allow up to 2 not-yet-accepted connection requests. -- https://mail.python.org/mailman/listinfo/python-list