code: def dataReceived(self, data):
          
          self.bytes_in += (len(data))
          self.buffer_in = self.buffer_in + data
  
          while self.CheckDataReceived():
              pass
docs: Called from Twisted whenever data is received.