Skip to content

Commit

Permalink
more robust WebSocket close detection in the sync client (Fixes #346)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Feb 29, 2024
1 parent 1dbd573 commit ec2df3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engineio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def _read_loop_websocket(self):
p = None
try:
p = self.ws.recv()
if len(p) == 0: # pragma: no cover
if len(p) == 0 and not self.ws.connected: # pragma: no cover
# websocket client can return an empty string after close
raise websocket.WebSocketConnectionClosedException()
except websocket.WebSocketTimeoutException:
Expand Down

0 comments on commit ec2df3f

Please sign in to comment.