protocol.py 文件源码

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

项目:SameKeyProxy 作者: xzhou 项目源码 文件源码
def _remoteInvocationMobileCode(self, method, flags, *args):
        # special trimmed-down version for mobile code methods (no locking etc)
        body=pickle.dumps((self.URI.objectID,method,flags,args),Pyro.config.PYRO_PICKLE_FORMAT)
        sock_sendmsg(self.conn.sock, self.createMsg(body), self.timeout)
        ver,answer,pflags = self.receiveMsg(self.conn,1)
        if answer is None:
            raise ProtocolError('incorrect answer received')
        answer=pickle.loads(answer)
        if isinstance(answer,PyroExceptionCapsule):
            if isinstance(answer.excObj,_InternalNoModuleError):
                # server couldn't load module, supply it
                return self.processMissingModuleError(answer.excObj, method, flags, args)
            else:
                # we have an encapsulated exception, raise it again.
                answer.raiseEx()
        return answer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号