Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very slow association with invalid adresses - Need to use custom timeout during connecting #483

Open
qarmin opened this issue Mar 20, 2024 Discussed in #480 · 1 comment
Labels
A-lib Area: library C-ul Crate: dicom-ul

Comments

@qarmin
Copy link

qarmin commented Mar 20, 2024

Because this can be implemented, I am changing the discussion in the issue to make it more visible

Discussed in #480

Originally posted by qarmin March 19, 2024
I have this code

    debug!("Establishing association with '{}'...", &addr);
    let mut scu_opt = ClientAssociationOptions::new()
        .with_abstract_syntax(abstract_syntax)
        .called_ae_title(aetitle)
        .max_pdu_length(max_pdu_length);

    if !station_name.is_empty() {
        scu_opt = scu_opt.calling_ae_title(station_name);
    }

    let scu = scu_opt
        .establish_with(addr)
        .map_err(|_e| DicomError::CommonError(format!("Failed to establish connection with {addr}")))?;

    debug!("Association established");
    Ok(scu)
}

and after trying to connect to invalid address, after 2 minutes I have info, that dicom failed to establish connection.
Can this be speed up?
Can I use any workaround?

11:29:01.681 [DEBUG] Establishing association with '192.168.10.124:4242'...
11:31:16.409 [ERROR] Failed to get patients from worklist: Failed to establish connection with 192.168.10.124:4242
@Enet4 Enet4 added A-lib Area: library C-ul Crate: dicom-ul labels Mar 20, 2024
@naterichman
Copy link
Contributor

Hi @qarmin can you see if #530 fixed your issue? You should be able to now do

    debug!("Establishing association with '{}'...", &addr);
    let mut scu_opt = ClientAssociationOptions::new()
        .with_abstract_syntax(abstract_syntax)
        .called_ae_title(aetitle)
        .read_timeout(20)
        .max_pdu_length(max_pdu_length);

By setting this, when you call establish it should return with an error after 20s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library C-ul Crate: dicom-ul
Projects
None yet
Development

No branches or pull requests

3 participants