Close expired pending connections (waiting for initial data).
(self)
| 331 | conn.close() |
| 332 | |
| 333 | def murder_pending(self): |
| 334 | """Close expired pending connections (waiting for initial data).""" |
| 335 | now = time.monotonic() |
| 336 | while self.pending_conns: |
| 337 | conn = self.pending_conns[0] |
| 338 | delta = conn.timeout - now |
| 339 | if delta > 0: |
| 340 | break |
| 341 | |
| 342 | # Connection has timed out waiting for data |
| 343 | self.pending_conns.popleft() |
| 344 | try: |
| 345 | self.poller.unregister(conn.sock) |
| 346 | except (OSError, KeyError, ValueError): |
| 347 | pass # Already unregistered |
| 348 | self.nr_conns -= 1 |
| 349 | conn.close() |
| 350 | |
| 351 | def is_parent_alive(self): |
| 352 | # If our parent changed then we shut down. |