Socket: Match the expected API of reconnect

driver.reconnect(wait=True) should flag a driver to reconnect, but not
immediately.  The Socket driver lost its handling of this flag in
8730832e.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2013-08-24 00:29:16 -04:00
parent a483fef39d
commit ea7f1f8419

View File

@ -152,7 +152,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
def connect(self, **kwargs):
self.reconnect(reset=False, **kwargs)
def reconnect(self, reset=True):
def reconnect(self, wait=False, reset=True):
self.nextReconnectTime = None
if self.connected:
drivers.log.reconnect(self.irc.network)
@ -163,6 +163,9 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
self.irc.reset()
else:
drivers.log.debug('Not resetting %s.', self.irc)
if wait:
self.scheduleReconnect()
return
server = self._getNextServer()
host = server[0]
address = None