mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 02:24:12 +01:00
Made it reset the IRC object before reconnection, and made it catch connect errors.
This commit is contained in:
parent
57b21b6394
commit
2bd4a88d76
@ -96,11 +96,16 @@ class SocketDriver(drivers.IrcDriver):
|
||||
#debug.methodNamePrintf(self, 'reconnect')
|
||||
self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.conn.settimeout(conf.poll)
|
||||
self.conn.connect(self.server)
|
||||
try:
|
||||
self.conn.connect(self.server)
|
||||
except socket.error, e:
|
||||
debug.msg('Error connecting to %s: %s' % (self.server, e))
|
||||
self.die()
|
||||
self.connected = True
|
||||
|
||||
def die(self):
|
||||
#debug.methodNamePrintf(self, 'die')
|
||||
self.irc.reset()
|
||||
self.conn.close()
|
||||
self.connected = False
|
||||
schedule.addEvent(self.reconnect, time.time()+300)
|
||||
|
Loading…
Reference in New Issue
Block a user