Cleanup client connection if timeout
()
| 448 | pool_dst[key] = handler |
| 449 | |
| 450 | def cleanup(): |
| 451 | """Cleanup client connection if timeout""" |
| 452 | if pool_dst.get(key, None) == handler: |
| 453 | logging.info( |
| 454 | "Timeout client connection %s, cannot find match key=%s", |
| 455 | handler.name(), |
| 456 | key, |
| 457 | ) |
| 458 | pool_dst.pop(key) |
| 459 | handler.send_data(struct.pack("<i", base.RPC_CODE_MISMATCH)) |
| 460 | handler.signal_close() |
| 461 | |
| 462 | self.loop.call_later(timeout, cleanup) |
| 463 | else: |