Open debbabi opened 9 years ago
Another solution could be to use a third argument in self._bot.connect()
, which is reattempt
(boolean).
In this case, it would also be necessary to add a reconnect_max_attempts
member to the self._bot
object to control the number of attempts.
self._bot.reconnect_max_attempts = 3
if not self._bot.connect(self._host, self._port, True):
_logger.error("Can't connect to the XMPP server at %s port %s",
self._host, self._port)
Looking at the Event Index of SleekXMPP, the following ones could give hints about connection failures:
Line: 162 https://github.com/isandlaTech/cohorte-herald/blob/master/python/herald/transports/xmpp/transport.py#L162
Fix by something like that one: