Skip to content

Commit bd9c003

Browse files
authored
Merge pull request #2 from ShaneHarvey/PYTHON-4636-fix-windows-recv
PYTHON-4636 Properly check for socket close on windows
2 parents 4ddb553 + 1e9a134 commit bd9c003

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pymongo/network_layer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ async def _async_receive_ssl(
201201
while total_read < length:
202202
try:
203203
read = conn.recv_into(mv[total_read:])
204+
if read == 0:
205+
raise OSError("connection closed")
204206
except BLOCKING_IO_ERRORS:
205207
await asyncio.sleep(0.5)
206208
read = 0

0 commit comments

Comments
 (0)