MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / runonce

Function runonce

sshuttle/ssnet.py:591–616  ·  view source on GitHub ↗
(handlers, mux)

Source from the content-addressed store, hash-verified

589
590
591def runonce(handlers, mux):
592 r = []
593 w = []
594 x = []
595 to_remove = [s for s in handlers if not s.ok]
596 for h in to_remove:
597 handlers.remove(h)
598
599 for s in handlers:
600 s.pre_select(r, w, x)
601 debug2('Waiting: %d r=%r w=%r x=%r (fullness=%d/%d)'
602 % (len(handlers), _fds(r), _fds(w), _fds(x),
603 mux.fullness, mux.too_full))
604 (r, w, x) = select.select(r, w, x)
605 debug2(' Ready: %d r=%r w=%r x=%r'
606 % (len(handlers), _fds(r), _fds(w), _fds(x)))
607 ready = r + w + x
608 did = {}
609 for h in handlers:
610 for s in h.socks:
611 if s in ready:
612 h.callback(s)
613 did[s] = 1
614 for s in ready:
615 if s not in did:
616 raise Fatal('socket %r was not used by any handler' % s)

Callers

nothing calls this directly

Calls 6

debug2Function · 0.90
FatalClass · 0.90
_fdsFunction · 0.85
removeMethod · 0.80
pre_selectMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected