Package Anomos :: Package Protocol :: Class AnomosProtocol
[hide private]
[frames] | no frames]

Class AnomosProtocol

source code

object --+
         |
        AnomosProtocol
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
network_ctl_msg(self, type, message='')
Send message for network messages, ie.
source code
 
got_message(self, message)
Handles an incoming message.
source code
 
invalid_message(self, t) source code
 
_valid_msg_len(self, m)
Check length of received message m against dictionary of valid message lengths
source code
 
format_message(self, type, message='')
Anomos messages are slightly different from BitTorrent messages because of the virtual streams used to keep the number of active connections low.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

network_ctl_msg(self, type, message='')

source code 

Send message for network messages, ie. CONFIRM, TCODE and for relaying messages

got_message(self, message)

source code 

Handles an incoming message. First byte designates message type, may be any one of (CHOKE, UNCHOKE, INTERESTED, NOT_INTERESTED, HAVE, BITFIELD, REQUEST, PIECE, CANCEL)

format_message(self, type, message='')

source code 

Anomos messages are slightly different from BitTorrent messages because of the virtual streams used to keep the number of active connections low. All messages are prefixed with a 2-byte Stream ID. The format is thus: [StreamID][Message Length][Type][Payload]

Parameters:
  • type (char (strictly 1 byte)) - TCODE, RELAY, BREAK, CHOKE, etc...
  • message (string) - Message type appropriate payload