epmd.py 文件源码

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

项目:Pyrlang 作者: esl 项目源码 文件源码
def _read_alive2_reply(self) -> int:
        """ Read reply from ALIVE2 request, check the result code, read creation

            :return: Creation value if all is well, connection remains on.
                On error returns -1
        """
        # Reply will be [121,0,Creation:16] for OK, otherwise [121,Error]
        reply = self.sock_.recv(2)
        if not reply:
            print("EPMD: ALIVE2 Read error. Closed?", reply)
            return -1

        if reply[1] == 0:
            cr = self.sock_.recv(2)
            (creation,) = struct.unpack(">H", cr)
            return creation

        print("EPMD: ALIVE2 returned error", reply[1])
        return -1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号