mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
Tweaked.
This commit is contained in:
parent
fc312008ad
commit
82d6966885
@ -75,7 +75,7 @@ class SocketDriver(drivers.IrcDriver):
|
|||||||
self.eagains = 0
|
self.eagains = 0
|
||||||
self.reconnectWaitsIndex = 0
|
self.reconnectWaitsIndex = 0
|
||||||
self.reconnectWaits = reconnectWaits
|
self.reconnectWaits = reconnectWaits
|
||||||
self.reconnect()
|
self.connect()
|
||||||
|
|
||||||
def _sendIfMsgs(self):
|
def _sendIfMsgs(self):
|
||||||
msgs = [self.irc.takeMsg()]
|
msgs = [self.irc.takeMsg()]
|
||||||
@ -128,7 +128,10 @@ class SocketDriver(drivers.IrcDriver):
|
|||||||
return
|
return
|
||||||
self._sendIfMsgs()
|
self._sendIfMsgs()
|
||||||
|
|
||||||
def reconnect(self, wait=False):
|
def connect(self, wait=False):
|
||||||
|
self.reconnect(wait, reset=False)
|
||||||
|
|
||||||
|
def reconnect(self, wait=False, reset=True):
|
||||||
if self.connected:
|
if self.connected:
|
||||||
log.info('Reconnect called on driver for %s.' % self.irc)
|
log.info('Reconnect called on driver for %s.' % self.irc)
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
@ -139,7 +142,8 @@ class SocketDriver(drivers.IrcDriver):
|
|||||||
log.info('Reconnect waiting.')
|
log.info('Reconnect waiting.')
|
||||||
self._scheduleReconnect()
|
self._scheduleReconnect()
|
||||||
return
|
return
|
||||||
self.irc.reset()
|
if reset:
|
||||||
|
self.irc.reset()
|
||||||
try:
|
try:
|
||||||
self.conn = utils.getSocket(self.server[0])
|
self.conn = utils.getSocket(self.server[0])
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user