我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用gevent.socket.getaddrinfo()。
def test_getaddrinfo_mp(self): """This test would make gevent's hub threadpool kill upon hub destruction in child block forever. Gipc resolves this by killing threadpool even harder. """ import gevent.socket as socket socket.getaddrinfo("localhost", 21) p = start_process(target=complchild_test_getaddrinfo_mp) p.join(timeout=1) assert p.exitcode == 0
def patch_dns(): from gevent.socket import gethostbyname, getaddrinfo _socket = __import__('socket') _socket.getaddrinfo = getaddrinfo _socket.gethostbyname = gethostbyname