Commit c5b6a1a2 authored by Denis Bilenko's avatar Denis Bilenko

gevent.socket: add BlockingResolver class

parent 08af2499
......@@ -627,6 +627,22 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
raise error("getaddrinfo returns an empty list")
class BlockingResolver(object):
def __init__(self, hub=None):
pass
def close(self):
pass
for method in ['gethostbyname',
'gethostbyname_ex',
'getaddrinfo',
'gethostbyaddr',
'getnameinfo']:
locals()[method] = staticmethod(getattr(_socket, method))
def gethostbyname(hostname):
return get_hub().resolver.gethostbyname(hostname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment