def connectionLost(self, reason=connectionDone):
logger.info('%s disconnected. remainder connected: %s',
self.transport.getPeer().host,
str(self.factory.connections)) # , reason
try:
self.factory.peer_connections.remove(self)
if self.factory.connections == 0:
reactor.callLater(60, self.factory.connect_peers)
# FIXME: unsafe access to synced_peers
if self in self.factory.synced_peers:
self.factory.synced_peers.remove(self)
except Exception:
pass
评论列表
文章目录