update dns
This commit is contained in:
parent
cdd333ea97
commit
5c274a1bc7
1 changed files with 2 additions and 0 deletions
|
@ -296,6 +296,7 @@ class DNSResolver(object):
|
||||||
if self._loop:
|
if self._loop:
|
||||||
raise Exception('already add to loop')
|
raise Exception('already add to loop')
|
||||||
self._loop = loop
|
self._loop = loop
|
||||||
|
# TODO when dns server is IPv6
|
||||||
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
|
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
|
||||||
socket.SOL_UDP)
|
socket.SOL_UDP)
|
||||||
self._sock.setblocking(False)
|
self._sock.setblocking(False)
|
||||||
|
@ -339,6 +340,7 @@ class DNSResolver(object):
|
||||||
logging.error('dns socket err')
|
logging.error('dns socket err')
|
||||||
self._loop.remove(self._sock)
|
self._loop.remove(self._sock)
|
||||||
self._sock.close()
|
self._sock.close()
|
||||||
|
# TODO when dns server is IPv6
|
||||||
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
|
self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
|
||||||
socket.SOL_UDP)
|
socket.SOL_UDP)
|
||||||
self._sock.setblocking(False)
|
self._sock.setblocking(False)
|
||||||
|
|
Loading…
Reference in a new issue