Skip to content

Commit 36203df

Browse files
committed
add test.
1 parent 27b7e51 commit 36203df

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/test/test_socket.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,15 @@ def test_listen_backlog(self):
17201720
srv.bind((HOST, 0))
17211721
srv.listen()
17221722

1723+
def test_listen_backlog_connect(self):
1724+
for backlog in 0, -1:
1725+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as srv:
1726+
srv.bind((HOST, 65200))
1727+
srv.listen(backlog)
1728+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as c:
1729+
c.connect((HOST, 65200))
1730+
c.send(MSG)
1731+
17231732
@support.cpython_only
17241733
def test_listen_backlog_overflow(self):
17251734
# Issue 15989

0 commit comments

Comments
 (0)