code: def handle_client_stream(self, stream, is_unix=False):
          
  
          assert stream
          data = []
          stream.settimeout(2)
          while True:
              try:
                  if is_unix:
                      buf = stream.recv(1024)
                  else:
                      buf = stream.read(1024)
                  if not buf:
                      break
                  data.append(buf)
              except (AttributeError, ValueError) as message:
                  logger.error(message)
                  return
              except (ssl.SSLError) as exception:
                  logger.debug('Error: %s', exception[0])
                  break
              except (socket.timeout) as exception:
                  logger.debug('Error: %s', exception)
                  break
          data = b''.join(data)
          if len(data) <= 0:
              logger.debug("Empty client stream")
              return
          try:
              response = self.handle_command(data)
          except OSPDError as exception:
              response = exception.as_xml()
              logger.debug('Command error: %s', exception.message)
          except Exception:
              logger.exception('While handling client command:')
              exception = OSPDError('Fatal error', 'error')
              response = exception.as_xml()
          if is_unix:
              send_method = stream.send
          else:
              send_method = stream.write
          self.write_to_stream(send_method, response)
docs: Handles stream of data received from client.