mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
order to accept exactly one connection. Patch by Daniel Evers.
This commit is contained in:
commit
3cade9942e
5 changed files with 20 additions and 6 deletions
|
|
@ -797,6 +797,13 @@ class GeneralModuleTests(unittest.TestCase):
|
|||
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
self.assertRaises(TypeError, pickle.dumps, sock, protocol)
|
||||
|
||||
def test_listen_backlog0(self):
|
||||
srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
srv.bind((HOST, 0))
|
||||
# backlog = 0
|
||||
srv.listen(0)
|
||||
srv.close()
|
||||
|
||||
|
||||
@unittest.skipUnless(thread, 'Threading required for this test.')
|
||||
class BasicTCPTest(SocketConnectedTest):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue