From 9e79386595bd7f8c2fa43b837e5afd1ca5b85fc5 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Tue, 30 Jan 2018 13:55:01 +0200 Subject: [PATCH] Set state to "close" and call `handle_close()` for all connections --- src/network/connectionpool.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/network/connectionpool.py b/src/network/connectionpool.py index 44534a76..793e284f 100644 --- a/src/network/connectionpool.py +++ b/src/network/connectionpool.py @@ -203,6 +203,14 @@ class BMConnectionPool(object): continue self.lastSpawned = time.time() + else: + for i in ( + self.inboundConnections.values() + + self.outboundConnections.values() + ): + i.set_state("close") + # FIXME: rating will be increased after next connection + i.handle_close() if acceptConnections: if not self.listeningSockets: