Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

src/a/n/Anomos-HEAD/Anomos/Protocol/AnomosEndPointProtocol.py   Anomos(Download)
# Written by John Schanck
 
from Anomos.Protocol import CHOKE, UNCHOKE, INTERESTED, NOT_INTERESTED, \
                            HAVE, BITFIELD, REQUEST, PIECE, CANCEL, \
                            TCODE, CONFIRM, ENCRYPTED, BREAK, PARTIAL, \
    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,\
    def send_unchoke(self):
        self.transfer_ctl_msg(UNCHOKE)
        self.choke_sent = False
    def send_request(self, index, begin, length):
        self.transfer_ctl_msg(REQUEST, tobinary(index) +

src/a/n/Anomos-HEAD/Anomos/Protocol/AnomosRelayerProtocol.py   Anomos(Download)
# Written by John Schanck
 
from Anomos.Protocol import TCODE, CONFIRM, UNCHOKE, CHOKE, ENCRYPTED, BREAK, PARTIAL, ACKBREAK
from Anomos.Protocol import AnomosProtocol, toint
from Anomos import bttime, log_on_call, LOG as log