Skip to content

Instantly share code, notes, and snippets.

@progval
Created July 24, 2018 15:44
Show Gist options
  • Save progval/6aadc77426dbae6316439e1574bcabb0 to your computer and use it in GitHub Desktop.
Save progval/6aadc77426dbae6316439e1574bcabb0 to your computer and use it in GitHub Desktop.
diff --git a/src/drivers/Socket.py b/src/drivers/Socket.py
index c9e9d19f..08787fb4 100644
--- a/src/drivers/Socket.py
+++ b/src/drivers/Socket.py
@@ -223,7 +223,13 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
def connect(self, **kwargs):
self.reconnect(reset=False, **kwargs)
- def reconnect(self, wait=False, reset=True):
+ def reconnect(self, **kwargs):
+ self._reconnect_thread = world.SupyThread(
+ target=self._reconnect, kwargs=kwargs,
+ name='connect_to_%s' % self.irc)
+ self._reconnect_thread.start()
+
+ def _reconnect(self, wait=False, reset=True):
self._attempt += 1
self.nextReconnectTime = None
if self.connected:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment