MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / runonce

Function runonce

ssnet.py:534–559  ·  view source on GitHub ↗
(handlers, mux)

Source from the content-addressed store, hash-verified

532
533
534def runonce(handlers, mux):
535 r = []
536 w = []
537 x = []
538 to_remove = filter(lambda s: not s.ok, handlers)
539 for h in to_remove:
540 handlers.remove(h)
541
542 for s in handlers:
543 s.pre_select(r,w,x)
544 debug2('Waiting: %d r=%r w=%r x=%r (fullness=%d/%d)\n'
545 % (len(handlers), _fds(r), _fds(w), _fds(x),
546 mux.fullness, mux.too_full))
547 (r,w,x) = select.select(r,w,x)
548 debug2(' Ready: %d r=%r w=%r x=%r\n'
549 % (len(handlers), _fds(r), _fds(w), _fds(x)))
550 ready = r+w+x
551 did = {}
552 for h in handlers:
553 for s in h.socks:
554 if s in ready:
555 h.callback()
556 did[s] = 1
557 for s in ready:
558 if not s in did:
559 raise Fatal('socket %r was not used by any handler' % s)

Callers

nothing calls this directly

Calls 5

debug2Function · 0.85
_fdsFunction · 0.85
FatalClass · 0.85
pre_selectMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected