This commit is contained in:
Jeremy Fincher 2004-07-26 06:22:27 +00:00
parent fc312008ad
commit 82d6966885
1 changed files with 7 additions and 3 deletions

View File

@ -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: