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

All Samples(23)  |  Call(17)  |  Derive(0)  |  Import(6)

src/a/n/Anomos-HEAD/Anomos/Protocol/AnomosEndPointProtocol.py   Anomos(Download)
                            TCODE, CONFIRM, ENCRYPTED, BREAK, PARTIAL, \
                            ACKBREAK
from Anomos.Protocol import tobinary, toint, AnomosProtocol
from Anomos.bitfield import Bitfield
from Anomos import log_on_call, LOG as log
    def got_partial(self, message):
        p_remain = toint(message[1:5])
        payload = message[5:]
        self.partial_recv += payload
        if len(self.partial_recv) > self.neighbor.config['max_message_length']:
    def got_have(self, message):
        i = toint(message[1:])
        if i >= self.torrent.numpieces:
            log.error("Piece index out of range")
            self.fatal_error()
    def got_request(self, message):
        i = toint(message[1:5])
        if i >= self.torrent.numpieces:
            self.fatal_error("Piece index out of range")
            return
        if self.upload:
            self.upload.got_request(i, toint(message[5:9]), toint(message[9:]))

src/a/n/Anomos-HEAD/Anomos/Protocol/AnomosNeighborProtocol.py   Anomos(Download)
import Anomos.Crypto
 
from Anomos.Protocol import PARTIAL, TCODE, tobinary, toint, AnomosProtocol
from Anomos.TCReader import TCReader
from Anomos import LOG as log
    def got_partial(self, message):
        p_remain = toint(message[1:5])
        payload = message[5:]
        self.partial_recv += payload
        if len(self.partial_recv) > self.config['max_message_length']:

src/a/n/Anomos-HEAD/Anomos/Protocol/AnomosRelayerProtocol.py   Anomos(Download)
 
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
 
    def got_partial(self, message):
        p_remain = toint(message[1:5])
        self.partial_recv += message[5:]
        if len(self.partial_recv) > self.neighbor.config['max_message_length']:
            log.error("Received message longer than max length")

src/a/n/Anomos-HEAD/Anomos/controlsocket.py   Anomos(Download)
from Anomos import BTFailure, LOG as log
 
from Anomos.Protocol import toint, tobinary
 
class MessageReceiver(asyncore.dispatcher):
    def _read_messages(self):
        yield 4
        l = toint(self._message)
        yield l
        action = self._message
        yield 4
        l = toint(self._message)

src/a/n/Anomos-HEAD/Anomos/NeighborLink.py   Anomos(Download)
from Anomos import LOG as log
 
from Anomos.Protocol import toint
 
class NeighborLink(AnomosNeighborProtocol):
        while True:
            yield 2 # Stream ID
            stream = toint(self._message)
            handler = self.get_stream_handler(stream)
            self._message = ''
            yield 4   # Message Length
            l = toint(self._message)

src/a/n/Anomos-HEAD/Anomos/Crypto/_Certificate.py   Anomos(Download)
 
from Anomos import bttime, LOG as log
from Anomos.Protocol import toint
from Anomos.Crypto import global_cryptodir, global_randfile, global_certpath
from Anomos.Crypto import CryptoError
        content = sessionkey.decrypt(data[rsa_keysize_B:])
        msglen = content[:4] # first 4 bytes
        msglen_int = toint(msglen)
        pos = 4
        message = content[pos:pos+msglen_int] # next msglen_int bytes