Example #1
0
 def __init__(self):
     AnomosProtocol.__init__(self)
     self.msgmap.update({#CHOKE: self.got_choke,\
                         #UNCHOKE: self.got_unchoke,\
                         CONFIRM: self.got_confirm, \
                         BREAK: self.got_break,\
                         ENCRYPTED: self.relay_message,\
                         PARTIAL: self.got_partial,\
                         ACKBREAK: self.got_ack_break})
Example #2
0
 def __init__(self):
     AnomosProtocol.__init__(self)
     #msgmap := Lookup table for methods to use when responding to message types
     self.msgmap.update({CHOKE: self.got_choke,\
                         UNCHOKE: self.got_unchoke,\
                         INTERESTED: self.got_interested,\
                         NOT_INTERESTED: self.got_not_interested,\
                         HAVE: self.got_have,\
                         BITFIELD: self.got_bitfield,\
                         REQUEST: self.got_request,\
                         PIECE: self.got_piece,\
                         CANCEL: self.got_cancel,\
                         CONFIRM: self.got_confirm, \
                         ENCRYPTED: self.got_encrypted, \
                         BREAK: self.got_break, \
                         PARTIAL: self.got_partial, \
                         ACKBREAK: self.got_ack_break})
Example #3
0
    def __init__(self):
        AnomosProtocol.__init__(self)

        self.msgmap.update({PARTIAL:self.got_partial,
                            TCODE: self.got_tcode})