facto.py 文件源码

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

项目:ansibilo 作者: Polyconseil 项目源码 文件源码
def is_iana_reserved_port(port, protocol):
    """
    Check whether the port is reserved by IANA
    Args:
        port (int): port
        protocol (str): application protocol (tcp or udp)
    Return:
        bool: whether the port is reserved by IANA
    """
    try:
        socket.getservbyport(port, protocol)
        return True
    except socket.error:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号