code: def rawDataReceived(self, data):
          
          self._rawBuffer.append(data)
          self._rawBufferLength += len(data)
  
          if self._rawBufferLength >= self._expectedLength:
              receivedData = ''.join(self._rawBuffer)
              expectedData = receivedData[:self._expectedLength]
              extraData = receivedData[self._expectedLength:]
  
              self._rawBuffer = None
              self._rawBufferLength = None
              self._expectedLength = None
  
              self.datagramReceived(expectedData)
              self.setLineMode(extraData)
docs: Called when raw data is received.
  
          Fill the raw buffer C{_rawBuffer} until we have received at least
          C{_expectedLength} bytes. Call C{datagramReceived} with the received
          byte string of the expected size. Then switch back to line mode with
          the remainder of the buffer.