This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gevent | |
import gevent.event | |
import gevent.socket | |
import gevent.pool | |
def open_tcp_socket(hostname, port, *, timeout=0.250): | |
targets = gevent.socket.getaddrinfo(hostname, port, type=gevent.socket.SOCK_STREAM) | |
result = gevent.event.AsyncResult() | |
group = gevent.pool.Group() |