code: def _recv_loop(self):
          
          self._completed_response_lines = []
          self._is_multiline = None
          lines_iterator = self._get_lines()
          while True:
              try:
                  line = next(lines_iterator)
                  if self._is_multiline is None:
                      self._is_multiline = line.startswith("!") or line == "."
                  if line.startswith("ERR"):
                      self._respond(ValueError(line))
                  elif self._is_multiline:
                      if line == ".":
                          self._respond(self._completed_response_lines)
                      else:
                          assert line[0] == "!", \
                              "Multiline response {} doesn't start with !" \
                              .format(repr(line))
                          self._completed_response_lines.append(line[1:])
                  else:
                      self._respond(line)
              except StopIteration:
                  return
              except Exception:
                  log.exception("Exception receiving message")
                  raise
docs: Service socket recv, returning responses to the correct queue