Messages are split into chunks. Chunks and messages are delimited
        by the regex #RE_NC11_DELIM defined earlier in this file. Each
        time we get called here either a chunk delimiter or an
        end-of-message delimiter should be found iff there is enough
        data. If there is not enough data, we will wait for more. If a
        delimiter is found in the wrong place, a #NetconfFramingError
        will be raised.

def _parse11(self):

        """Messages are split into chunks. Chunks and messages are delimited
        by the regex #RE_NC11_DELIM defined earlier in this file. Each
        time we get called here either a chunk delimiter or an
        end-of-message delimiter should be found iff there is enough
        data. If there is not enough data, we will wait for more. If a
        delimiter is found in the wrong place, a #NetconfFramingError
        will be raised."""

        self.logger.debug("_parse11: starting")

        # suck in whole string that we have (this is what we will work on in
        # this function) and initialize a couple of useful values
        self._buffer.seek(0, os.SEEK_SET)
        data = self._buffer.getvalue()
        data_len = len(data)
        start = 0
        self.logger.debug('_parse11: working with buffer of %d bytes', data_len)
        while True and start < data_len:
            # match to see if we found at least some kind of delimiter
            self.logger.debug('_parse11: matching from %d bytes from start of buffer', start)
            re_result = RE_NC11_DELIM.match(data[start:])
            if not re_result:

                # not found any kind of delimiter just break; this should only
                # ever happen if we just have the first few characters of a
                # message such that we don't yet have a full delimiter
                self.logger.debug('_parse11: no delimiter found, buffer="%s"', data[start:].decode())
                break

            # save useful variables for reuse
            re_start = re_result.start()
            re_end = re_result.end()
            self.logger.debug('_parse11: regular expression start=%d, end=%d', re_start, re_end)

            # If the regex doesn't start at the beginning of the buffer,
            # we're in trouble, so throw an error
            if re_start != 0:
                raise NetconfFramingError('_parse11: delimiter not at start of match buffer', data[start:])

            if re_result.group(2):
                # we've found the end of the message, need to form up
                # whole message, save back remainder (if any) to buffer
                # and dispatch the message
                start += re_end
                message = ''.join(self._message_list)
                self._message_list = []
                self.logger.debug('_parse11: found end of message delimiter')
                self._dispatch_message(message)
                break

            elif re_result.group(1):
                # we've found a chunk delimiter, and group(2) is the digit
                # string that will tell us how many bytes past the end of
                # where it was found that we need to have available to
                # save the next chunk off
                self.logger.debug('_parse11: found chunk delimiter')
                digits = int(re_result.group(1))
                self.logger.debug('_parse11: chunk size %d bytes', digits)
                if (data_len-start) >= (re_end + digits):
                    # we have enough data for the chunk
                    fragment = textify(data[start+re_end:start+re_end+digits])
                    self._message_list.append(fragment)
                    start += re_end + digits
                    self.logger.debug('_parse11: appending %d bytes', digits)
                    self.logger.debug('_parse11: fragment = "%s"', fragment)
                else:
                    # we don't have enough bytes, just break out for now
                    # after updating start pointer to start of new chunk
                    start += re_start
                    self.logger.debug('_parse11: not enough data for chunk yet')
                    self.logger.debug('_parse11: setting start to %d', start)
                    break

        # Now out of the loop, need to see if we need to save back any content
        if start > 0:
            self.logger.debug(
                '_parse11: saving back rest of message after %d bytes, original size %d',
                start, data_len)
            self._buffer = StringIO(data[start:])
            if start < data_len:
                self.logger.debug('_parse11: still have data, may have another full message!')
                self._parse11()
        self.logger.debug('_parse11: ending')