Graceful shutdown; close #179

This commit is contained in:
clowwindy 2014-09-12 00:51:25 +08:00
parent 964d7613cb
commit 327c70e353
7 changed files with 46 additions and 22 deletions

View file

@ -324,7 +324,7 @@ class DNSResolver(object):
socket.SOL_UDP)
self._sock.setblocking(False)
loop.add(self._sock, eventloop.POLL_IN)
loop.add_handler(self.handle_events)
loop.add_handler(self.handle_events, ref=False)
def _call_callback(self, hostname, ip, error=None):
callbacks = self._hostname_to_cb.get(hostname, [])