mirror of
https://github.com/python/cpython.git
synced 2025-10-27 19:54:38 +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:
parent
cda41d3bf7
commit
1be815aac4
5 changed files with 20 additions and 6 deletions
|
|
@ -788,6 +788,13 @@ def test_name_closed_socketio(self):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue