common.peer (version 0.1, 9 April 2003)
index
e:\bothans\common\peer.py

Peer Management

 
Modules
            
cPickle
logging
common.message
common.messagereader
common.messagerouting
common.ping
random
socket
threading
time
 
Classes
            
exceptions.Exception
SocketCreationError
Peer
PingedPeer
TargetPeer
Peers
TargetPeers
 
class Peer
       A Peer is a distant host to which we are connected.
It provides two file like objects rfile and wfile for reading(receiving)
and writing(sending).
It also has methods to know for how much time it has been Idle
 
   Methods defined here:
_Peer__createRWFile = __createRWFile(self, socket)
_Peer__createReader = __createReader(self)
_Peer__createRouter = __createRouter(self)
You could possibly have passed an existing router on __init__
_Peer__createSocket = __createSocket(self)
_Peer__startReader = __startReader(self)
_Peer__startReaderRouter = __startReaderRouter(self)
_Peer__startRouter = __startRouter(self)
__init__(self, address, router, connection=None)
 -address is the address from which the peer is coming
-connection is the socket objet
active(self)
 To be called when some activity is seen from this peer.
address(self)
close(self)
 Close all files associated with the peer and the connection
closed(self)
connectToPeer(self)
getAddress(self)
idleFor(self)
reader(self)
router(self)
sendMessage(self, message)

Data and non-method functions defined here:
ROUTER_DEFAULT_SIZE = 20
__doc__ = ' A Peer is a distant host to which we are connec... know for how much time it has been Idle\n '
__module__ = 'common.peer'
 
class Peers
       
   Methods defined here:
__init__(self, type, router=None)
__iter__(self)
_addPeer(self, peer)
_closePeer(self, peer)
closeAll(self)
getLock(self)
newPeer(self, address, connection=None)
Check that the type of peer is correct
router(self)
searchByAddress(self, address)

Data and non-method functions defined here:
DEFAULT_ROUTER_SIZE = 20
__doc__ = None
__module__ = 'common.peer'
 
class PingedPeer(Peer)
       A PingedPeer is peer that has a background thread checking that it is still up.
 
   Methods defined here:
__init__(self, address, router, connection=None)
 See Peer#__init__ with
-router is the router to which PongHandlers will be added

Data and non-method functions defined here:
__doc__ = ' A PingedPeer is peer that has a background thread checking that it is still up.\n '
__module__ = 'common.peer'

Methods inherited from Peer:
_Peer__createRWFile = __createRWFile(self, socket)
_Peer__createReader = __createReader(self)
_Peer__createRouter = __createRouter(self)
You could possibly have passed an existing router on __init__
_Peer__createSocket = __createSocket(self)
_Peer__startReader = __startReader(self)
_Peer__startReaderRouter = __startReaderRouter(self)
_Peer__startRouter = __startRouter(self)
active(self)
 To be called when some activity is seen from this peer.
address(self)
close(self)
 Close all files associated with the peer and the connection
closed(self)
connectToPeer(self)
getAddress(self)
idleFor(self)
reader(self)
router(self)
sendMessage(self, message)

Data and non-method functions inherited from Peer:
ROUTER_DEFAULT_SIZE = 20
 
class SocketCreationError(exceptions.Exception)
       
   Data and non-method functions defined here:
__doc__ = None
__module__ = 'common.peer'

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)
 
class TargetPeer(Peer)
       
   Data and non-method functions defined here:
__doc__ = None
__module__ = 'common.peer'

Methods inherited from Peer:
_Peer__createRWFile = __createRWFile(self, socket)
_Peer__createReader = __createReader(self)
_Peer__createRouter = __createRouter(self)
You could possibly have passed an existing router on __init__
_Peer__createSocket = __createSocket(self)
_Peer__startReader = __startReader(self)
_Peer__startReaderRouter = __startReaderRouter(self)
_Peer__startRouter = __startRouter(self)
__init__(self, address, router, connection=None)
 -address is the address from which the peer is coming
-connection is the socket objet
active(self)
 To be called when some activity is seen from this peer.
address(self)
close(self)
 Close all files associated with the peer and the connection
closed(self)
connectToPeer(self)
getAddress(self)
idleFor(self)
reader(self)
router(self)
sendMessage(self, message)

Data and non-method functions inherited from Peer:
ROUTER_DEFAULT_SIZE = 20
 
class TargetPeers(Peers)
       
   Methods defined here:
newPeer(self, address, target)
 Create a new TargetPeer instance with
-address: address tuple of the target
-target : the target machine
searchByUid(self, uid)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'common.peer'

Methods inherited from Peers:
__init__(self, type, router=None)
__iter__(self)
_addPeer(self, peer)
_closePeer(self, peer)
closeAll(self)
getLock(self)
router(self)
searchByAddress(self, address)

Data and non-method functions inherited from Peers:
DEFAULT_ROUTER_SIZE = 20
 
Data
             __author__ = 'Michel Rasschaert <mrasschaert@neocles.com>, David Ferlier <david@netbsd-fr.org>'
__date__ = '9 April 2003'
__file__ = r'e:\bothans\common\peer.pyc'
__license__ = 'This file is part of Bothans\n\n Bothans is fre...lace, Suite 330, Boston, MA 02111-1307 USA\n '
__name__ = 'common.peer'
__status__ = 'alpha'
__version__ = '0.1'
log = <logging.Logger instance at 0x00805428>
 
Author
             Michel Rasschaert <mrasschaert@neocles.com>,                David  Ferlier <david@netbsd-fr.org>