Browse Source

Use private map for asynchat

dave/xdcc
dpedu 7 years ago
parent
commit
789dfc96c5
  1. 6
      pyircbot/irccore.py

6
pyircbot/irccore.py

@ -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…
Cancel
Save