summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-05-10 17:16:03 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-05-10 17:16:03 (GMT)
commit47d1d0dc30a81f507fd51cd4c2abfaec735fdf13 (patch)
tree8d3cfe4bebda74e33650984ba8d8f7594e26a545 /Lib/test/test_socket.py
parent351761236adc0196160370d09d818ffa7d4238ac (diff)
downloadcpython-47d1d0dc30a81f507fd51cd4c2abfaec735fdf13.zip
cpython-47d1d0dc30a81f507fd51cd4c2abfaec735fdf13.tar.gz
cpython-47d1d0dc30a81f507fd51cd4c2abfaec735fdf13.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.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 7ee16eb..12e09dd 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -700,6 +700,13 @@ class GeneralModuleTests(unittest.TestCase):
def test_sendall_interrupted_with_timeout(self):
self.check_sendall_interrupted(True)
+ 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):