epmd.py 文件源码

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

项目:Pyrlang 作者: esl 项目源码 文件源码
def _fire_forget_query(ip: str, query: bytes) -> bytes:
        """ Connect to node, fire the query, read and disconnect. """
        s = socket.create_connection(address=(ip, EPMD_DEFAULT_PORT),
                                     timeout=EPMD_REMOTE_DEFAULT_TIMEOUT)
        query1 = util.to_u16(len(query)) + query
        s.send(query1)

        # Expect that after everything is received, the peer will close
        # the socket automatically, so we will too
        result = b''
        while True:
            incoming = s.recv(4096)
            if incoming == b'':
                break

            result += incoming

        s.close()
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号