Reap closed connection fix

This commit is contained in:
Peter Šurda 2017-11-17 19:50:39 +01:00
parent 1e02d2b48a
commit 3c3d69e5de
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
1 changed files with 6 additions and 0 deletions

View File

@ -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)