Package isnLib :: Package net :: Module peerManager :: Class peerManager
[show private | hide private]
[frames | no frames]

Class peerManager


exposes some functions to remote node and mostly allows GUI to make some calls. Should also handle a peer cache, classify and filter incoming peer, also recommending peers to other nodes upon request.

A peer is a remote server, accepting incoming connections.
Method Summary
  __init__(self, env)
  addPeer(self, data)
  alivePeerCount(self)
get alive peer count
  getHealthyPeers(self, local)
returns a list of connected and alive peers.
  getPeers(self, max)
returns a list of managed peers
  getQueryPeers(self, qRoot)
returns a list of peers suitable for this query
  loadPeerCache(self)
  maintain(self)
called from time to time, does some house cleaning on internal data structures
  onPeerChange(self)
  receivedRemotePeers(self, peerList)
  reconnectPeer(self, peer)
try to reconnect this probably dead peer
  refreshPeers(self)
called once in a while to verify all peers state, dropping dead ones, requesting more, etc.
  removePeer(self, peer)
  requestMorePeers(self, amount)
request more peers
  savePeerCache(self)
  shutdown(self)

Method Details

alivePeerCount(self)

get alive peer count

getHealthyPeers(self, local=1)

returns a list of connected and alive peers. #TODO4: this should be cached for performance reasons. Iterating this on every query forward for example might be slow

getPeers(self, max)

returns a list of managed peers

getQueryPeers(self, qRoot)

returns a list of peers suitable for this query

#TODO4: currently the query is ignored. Later, some known peer info should be used when selecting query target peers

maintain(self)

called from time to time, does some house cleaning on internal data structures

reconnectPeer(self, peer)

try to reconnect this probably dead peer

refreshPeers(self)

called once in a while to verify all peers state, dropping dead ones, requesting more, etc.

requestMorePeers(self, amount)

request more peers

Generated by Epydoc 2.0 on Thu Dec 25 10:59:57 2003 http://epydoc.sf.net