Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
Fix closing a stream shouldn't raise an error
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfrbcsgo committed May 7, 2023
1 parent 1dca6da commit ae867a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mod_async_server/async_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ def peer_addr(self):
return self._peer_addr

def close(self):
self._parking_lot.close_socket(self._sock)
try:
self._parking_lot.close_socket(self._sock)
except Exception:
LOG_WARNING("Error closing stream.")
LOG_CURRENT_EXCEPTION()

@async_task
def receive(self, max_length):
Expand Down

0 comments on commit ae867a4

Please sign in to comment.