Skip to content

Commit

Permalink
helper function to install a stub resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
samrushing committed Apr 14, 2012
1 parent 6566061 commit f1b4b1c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions coro/dns/stub_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ def resolve_ipv4 (self, name):

def resolve_ipv6 (self, name):
return self.gethostbyname (name, packet.TYPE.AAAA)

def install (nameserver_ips):
"install a stub resolver into the coro socket layer"
coro.set_resolver (
stub_resolver (nameserver_ips)
)

0 comments on commit f1b4b1c

Please sign in to comment.