Skip to content

Commit

Permalink
Fix BrokenPipeError in reconnect method ettoreleandrotognoli#31 ettor…
Browse files Browse the repository at this point in the history
  • Loading branch information
bouhao01 committed Apr 26, 2020
1 parent 31309d8 commit 60a9775
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions asterisk/ami/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ def try_reconnect(self):
if response is not None and not response.is_error():
self.on_reconnect(self._ami_client, response)
return True
except (BrokenPipeError):
self._ami_client._socket.close()
self._ami_client._socket = None
self._ami_client.connect()
self.try_reconnect()
except:
pass
return False
Expand Down

0 comments on commit 60a9775

Please sign in to comment.