Use private map for asynchat
This commit is contained in:
parent
d1895cd126
commit
789dfc96c5
@ -45,9 +45,12 @@ class IRCCore(asynchat.async_chat):
|
||||
|
||||
# Set up hooks for modules
|
||||
self.initHooks()
|
||||
|
||||
# Map for asynchat
|
||||
self.asynmap = {}
|
||||
|
||||
def loop(self):
|
||||
asyncore.loop()
|
||||
asyncore.loop(map=self.asynmap)
|
||||
|
||||
def kill(self):
|
||||
"""TODO close the socket"""
|
||||
@ -106,6 +109,7 @@ class IRCCore(asynchat.async_chat):
|
||||
self.create_socket(socket_type, socket.SOCK_STREAM)
|
||||
|
||||
self.connect(socketInfo[0][4])
|
||||
self.asynmap[self._fileno] = self
|
||||
|
||||
def handle_connect(self):
|
||||
"""When asynchat indicates our socket is connected, fire the connect hook"""
|
||||
|
Loading…
Reference in New Issue
Block a user