import socket


def test_connection(host: str, port: int=22) -> bool:
    """
    Function will attempt to connect to the host and port.
    :param host: The host to attempt connecting to
    :param port: The port to attempt connecting to
    :return: A bool indicating if the attempt was successful or not.
    """
    sock = socket.socket()
    try:
        sock.connect((host, port))
        return True
    except Exception:
        return False
    finally:
        sock.close()