def remove(location):
_Peer._lock.acquire()
peer = _Peer.peers.pop((location.addr, location.port), None)
_Peer._lock.release()
if peer:
logger.debug('%s: peer %s terminated', peer.addrinfo.location, peer.location)
RTI._peer_closed_(peer.location)
peer.stream = False
_Peer._sign_locations.pop(peer.signature, None)
if peer.req_task:
peer.req_task.terminate()
if _Peer.status_task:
_Peer.status_task.send(PeerStatus(peer.location, peer.name, PeerStatus.Offline))
评论列表
文章目录