def wait_on_interfaces(interfaces, timeout=10):
 result = defaultdict(list)
 timeout = (time.time() + timeout)
 while ((len(result) < len(interfaces)) and (time.time() < timeout)):
  rin = [i for i in interfaces.values()]
  win = [i for i in interfaces.values() if i.unsent_requests]
  (rout, wout, xout) = select.select(rin, win, [], 1)
  for interface in wout:
   interface.send_requests()
  for interface in rout:
   responses = interface.get_responses()
   if responses:
    result[interface.server].extend(responses)
 return result

def wait_on_interfaces ( interfaces , timeout = 10 ) : result = defaultdict ( list ) timeout = ( time . time ( ) + timeout ) while ( ( len ( result ) < len ( interfaces ) ) and ( time . time ( ) < timeout ) ) : rin = [ i for i in interfaces . values ( ) ] win = [ i for i in interfaces . values ( ) if i . unsent_requests ] ( rout , wout , xout ) = select . select ( rin , win , [ ] , 1 ) for interface in wout : interface . send_requests ( ) for interface in rout : responses = interface . get_responses ( ) if responses : result [ interface . server ] . extend ( responses ) return result
return a map of servers to a list of tuples .