(now, mux)
| 472 | |
| 473 | |
| 474 | def expire_connections(now, mux): |
| 475 | remove = [] |
| 476 | for chan, timeout in dnsreqs.items(): |
| 477 | if timeout < now: |
| 478 | debug3('expiring dnsreqs channel=%d' % chan) |
| 479 | remove.append(chan) |
| 480 | del mux.channels[chan] |
| 481 | for chan in remove: |
| 482 | del dnsreqs[chan] |
| 483 | debug3('Remaining DNS requests: %d' % len(dnsreqs)) |
| 484 | |
| 485 | remove = [] |
| 486 | for peer, (chan, timeout) in udp_by_src.items(): |
| 487 | if timeout < now: |
| 488 | debug3('expiring UDP channel channel=%d peer=%r' % (chan, peer)) |
| 489 | mux.send(chan, ssnet.CMD_UDP_CLOSE, b'') |
| 490 | remove.append(peer) |
| 491 | del mux.channels[chan] |
| 492 | for peer in remove: |
| 493 | del udp_by_src[peer] |
| 494 | debug3('Remaining UDP channels: %d' % len(udp_by_src)) |
| 495 | |
| 496 | |
| 497 | def onaccept_tcp(listener, method, mux, handlers): |
no test coverage detected