def is_valid_port(port):
    """Checks if a given value might be an existing port. Must be between 1 and 65535, both included.

        :param port: Port candidate
        :type port: int, str
        :returns: True if is valid, False if not
        :rtype: bool
    """
    try:
        int_port = int(port)
    except ValueError:
        return False

    return 0 < int_port < 65536