diff options
author | Georg Lukas <georg@op-co.de> | 2020-03-29 14:16:11 +0200 |
---|---|---|
committer | Georg Lukas <georg@op-co.de> | 2020-03-29 14:21:05 +0200 |
commit | 621255027d5c0a5046d95cef8e80e448ef2ca991 (patch) | |
tree | ae3f081cc0b6f619fb5cc4019a0461ef5bc8bf7d /examples/gtalk_custom_domain.py | |
parent | efe316dc8cb2e75d27492e701cc615e4095f95ad (diff) | |
download | slixmpp-621255027d5c0a5046d95cef8e80e448ef2ca991.tar.gz slixmpp-621255027d5c0a5046d95cef8e80e448ef2ca991.tar.bz2 slixmpp-621255027d5c0a5046d95cef8e80e448ef2ca991.tar.xz slixmpp-621255027d5c0a5046d95cef8e80e448ef2ca991.zip |
Reset reconnect delay on manual reconnect, add delay event
This is just a hotfix workaround for an underlying problem. The
`_connect_routine` code is "blocking" (in an async way) for
`connect_loop_wait` seconds, so that a fresh-started manual reconnect
will be silenty delayed. This code does the following changes:
1. It moves the delay to before the DNS resolution (with the exponential
back-off it might well be that the DNS records are changed while
slixmpp is waiting).
2. It adds a new event `reconnect_delay` that gets passed the number of
seconds it will delay before actually reconnecting
3. It resets the `connect_loop_wait` timer on a manual connect/reconnect
call to fix the interactive experience.
A *proper fix* would replace the sleep in `_connect_routine` with a
properly timered re-invocation of it, but I don't understand enough of
asyncio for pulling off that magic, and this is actually a proper
improvement. Also I tested this and it works!
Diffstat (limited to 'examples/gtalk_custom_domain.py')
0 files changed, 0 insertions, 0 deletions