__init__.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:vivisect-py3 作者: bat-serjo 项目源码 文件源码
def sendMessage(self, mtype, objname, data):
        """
        Send message is responsable for transmission of cobra messages,
        and socket reconnection in the event that the send fails for network
        reasons.
        """

        # NOTE: for errors while using msgpack, we must send only the str
        if mtype == COBRA_ERROR and self.sflags & (SFLAG_MSGPACK | SFLAG_JSON):
            data = str(data)

        try:
            buf = self.dumps(data)
        except Exception as e:
            raise CobraPickleException("The arguments/attributes must be serializable: %s" % e)

        objname = toUtf8(objname)
        self.sendExact(struct.pack("<III", mtype, len(objname), len(buf)) + objname + buf)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号