INNER CODE UNIT · Python

raw_message_handler

unrealcv/unrealcv · client/python/unrealcv/__init__.py:283

    def raw_message_handler(self, raw_message):
        match = self.raw_message_regexp.match(raw_message)

        if match:
            [message_id, message_body] = (
                int(match.group(1)),
                match.group(2),
            )
            message_body = raw_message[len(match.group(1)) + 1 :]
            # Convert to utf-8 if it's not a byte array (as is the case for images)
            try:
                message_body = message_body.decode('utf-8')
            except UnicodeDecodeError:
                pass
            if message_id == self.recv_message_id:
                return message_body
            else:
                raise AssertionError(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…