From 3c3d69e5de70dbc01f3dfd6063d2775e89fdad12 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 17 Nov 2017 19:50:39 +0100 Subject: [PATCH] Reap closed connection fix --- src/network/connectionpool.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/network/connectionpool.py b/src/network/connectionpool.py index aa48093e..d0cbdcd0 100644 --- a/src/network/connectionpool.py +++ b/src/network/connectionpool.py @@ -242,5 +242,11 @@ class BMConnectionPool(object): for i in self.inboundConnections.values() + self.outboundConnections.values() + self.listeningSockets.values() + self.udpSockets.values(): if not (i.accepting or i.connecting or i.connected): reaper.append(i) + else: + try: + if i.state == "close": + reaper.append(i) + except AttributeError: + pass for i in reaper: self.removeConnection(i)