Skip to content

Commit 60a9775

Browse files
committed
Fix BrokenPipeError in reconnect method ettoreleandrotognoli#31 ettoreleandrotognoli#32
1 parent 31309d8 commit 60a9775

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

asterisk/ami/client.py

+5
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ def try_reconnect(self):
313313
if response is not None and not response.is_error():
314314
self.on_reconnect(self._ami_client, response)
315315
return True
316+
except (BrokenPipeError):
317+
self._ami_client._socket.close()
318+
self._ami_client._socket = None
319+
self._ami_client.connect()
320+
self.try_reconnect()
316321
except:
317322
pass
318323
return False

0 commit comments

Comments
 (0)