diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-10 17:16:29 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-10 17:16:29 (GMT) |
commit | 1be815aac49bc0dc3937eb3a618fc9f1a6deb51a (patch) | |
tree | 53a031df40dc4b8cebfb5b5fe586ffdecd78c392 /Lib/test/test_socket.py | |
parent | cda41d3bf74f97f8956eb9018bdc02c693b65282 (diff) | |
download | cpython-1be815aac49bc0dc3937eb3a618fc9f1a6deb51a.zip cpython-1be815aac49bc0dc3937eb3a618fc9f1a6deb51a.tar.gz cpython-1be815aac49bc0dc3937eb3a618fc9f1a6deb51a.tar.bz2 |
Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
order to accept exactly one connection. Patch by Daniel Evers.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index a948541..4100c34 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -788,6 +788,13 @@ class GeneralModuleTests(unittest.TestCase): fp.close() self.assertEqual(repr(fp), "<_io.BufferedReader name=-1>") + def testListenBacklog0(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): |