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

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

        def receivePacket(_socket, receiveBuffer):

    while not containsCompletePacket(receiveBuffer):
        data = _socket.recv(4096) #was 16384
        #Make sure we raise a socket error when the socket is hanging on a loose end (receiving no data after server restart) 
        if not data:
            raise socket.error('No data received - Remote end unexpectedly closed socket')
        receiveBuffer += data;

    packetSize = DecodeInt32(receiveBuffer[4:8])

    packet = receiveBuffer[0:packetSize]
    receiveBuffer = receiveBuffer[packetSize:len(receiveBuffer)]

    return [packet, receiveBuffer]
        


src/b/3/b3-1.9.2/b3/parsers/frostbite/connection.py   b3(Download)
        try:
            self._serverSocket.sendall(request)
            [response, self._receiveBuffer] = protocol.receivePacket(self._serverSocket, self._receiveBuffer)
        except socket.error, detail:
            raise FrostbiteNetworkException(detail)
                    self._auth()
                    self.subscribeToEvents()
                [tmppacket, self._receiveBuffer] = protocol.receivePacket(self._serverSocket, self._receiveBuffer)
                [isFromServer, isResponse, sequence, words] = protocol.DecodePacket(tmppacket)
                if isFromServer and not isResponse:

src/b/i/big-brother-bot-HEAD/b3/parsers/frostbite/connection.py   big-brother-bot(Download)
        try:
            self._serverSocket.sendall(request)
            [response, self._receiveBuffer] = protocol.receivePacket(self._serverSocket, self._receiveBuffer)
        except socket.error, detail:
            raise FrostbiteNetworkException(detail)
                    self._auth()
                    self.subscribeToEvents()
                [tmppacket, self._receiveBuffer] = protocol.receivePacket(self._serverSocket, self._receiveBuffer)
                [isFromServer, isResponse, sequence, words] = protocol.DecodePacket(tmppacket)
                if isFromServer and not isResponse: