code: def lineReceived(self, line):
          
          if line and line.isdigit():
              self._expectedLength = int(line)
              self._rawBuffer = []
              self._rawBufferLength = 0
              self.setRawMode()
          else:
              self.keepAliveReceived()
docs: Called when a line is received.
  
          We expect a length in bytes or an empty line for keep-alive. If
          we got a length, switch to raw mode to receive that amount of bytes.