-
Notifications
You must be signed in to change notification settings - Fork 631
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
Creating a TCP connection using DicomClient.SendAsync()
does not take AssociationRequestTimeoutInMs
into account
#1784
Comments
Currently, the AssociationRequestTimeoutInMs only is used when the AssociationRequest is sent to the server, after the networkstream has been created successfully. fo-dicom/FO-DICOM.Core/Network/DesktopNetworkStream.cs Lines 57 to 59 in f13ce2e
if the AssociationRequestTimeout would also include the creation of the networkstream, then this would be a breaking change. The current default value of 5 seconds might then be too low. |
I find it somewhat confusing that the AssociationRequestTimeoutInMs doesn't include the original tcp-handshake so I'd argue that introducing an additional configuration could improve how easy it is to understand.
Should it be discussed here or as a discussion? |
I guess it also might be discussed here. What I meant is, that we should think about pro and cont of including the time, that the creation of the networkstream takes, into the AssociationRequesttimeout. |
Two thoughts here:
// 1 second connection timeout
using var connectionTimeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(1));
var connectionRequest = new AdvancedDicomClientConnectionRequest
{
//...
};
using var connection = await AdvancedDicomClientConnectionFactory.OpenConnectionAsync(connectionRequest, connectionTimeoutCts.Token);
var openAssociationRequest = new AdvancedDicomClientAssociationRequest
{
//...
};
// 1 second association request timeout
using var associationRequestTimeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(1));
using var association = await connection.OpenAssociationAsync(openAssociationRequest, associationRequestTimeoutCts.Token); |
Describe the bug
Creating a TCP connection using
DicomClient.SendAsync()
does not takeAssociationRequestTimeoutInMs
into accountTo Reproduce
Running the example program takes about 20 seconds in Windows and 130 seconds in Ubuntu (WSL).
Windows 11
Ubuntu 22.04 (WSL)
Expected behavior
Since I set AssociationRequestTimeoutInMs I expected it to take 1 second.
Screenshots or test DICOM files
Same example program as linked above
Environment
Fellow Oak DICOM version: 5.1.2
OS: Windows 11
Platform: .NET 8
The text was updated successfully, but these errors were encountered: