1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
select([timeout]) -> number of ready file descriptors or 0 on timeout
Returns result from doing a select() on the curl multi file descriptor
with the given timeout.
This is a convenience function which simplifies the combined use of
``fdset()`` and the ``select`` module.
Example usage::
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, "https://curl.haxx.se")
m = pycurl.CurlMulti()
m.add_handle(c)
while 1:
ret, num_handles = m.perform()
if ret != pycurl.E_CALL_MULTI_PERFORM: break
while num_handles:
ret = m.select(1.0)
if ret == 0: continue
while 1:
ret, num_handles = m.perform()
if ret != pycurl.E_CALL_MULTI_PERFORM: break
|