编码请求为bytes.

        检查是否使用debug模式和是否对数据进行压缩.之后根据状态将python字典形式的请求编码为字节串.

        Parameters:

            response (bytes): - 响应的字节串编码

        Return:

            (Dict[str, Any]): - python字典形式的响应

def decoder(self, response: bytes):
        """编码请求为bytes.

        检查是否使用debug模式和是否对数据进行压缩.之后根据状态将python字典形式的请求编码为字节串.

        Parameters:

            response (bytes): - 响应的字节串编码

        Return:

            (Dict[str, Any]): - python字典形式的响应

        """
        response = response[:-(len(self.SEPARATOR))]
        if self.compreser is not None:
            response = self.compreser.decompress(response)
        if self.debug is True:
            response = json.loads(response.decode('utf-8'))
        else:
            response = msgpack.unpackb(response, encoding='utf-8')
        version = response.get("MPRPC")
        if version and version == self.VERSION:
            return response
        else:
            raise ProtocolException("Wrong Protocol")