You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have seen an exception being thrown when connecting to a DicomServer quickly after it is started.
In our case, we are starting a DicomServer that implements DicomService, IDicomServiceProvider, IDicomCStoreProvider and IDicomCEchoProvider.
Immediately after creation we use echoscu.exe to check the service is up. Frequently we get the following exception:
Exception listening for DICOM services, NullReferenceException {TargetSite=T CreateScp(FellowOakDicom.Network.INetworkStream), Message="Object reference not set to an instance of an object.", Data=[], InnerException=null, HelpLink=null, Source="fo-dicom.core", HResult=-2147467261, StackTrace=" at FellowOakDicom.Network.DicomServer`1.CreateScp(INetworkStream stream)\n at FellowOakDicom.Network.DicomServer`1.ListenForConnectionsAsync()"}
Our debugging has shown this is caused by DicomService (line 247) trying to access ServiceScope.ServiceProvider. ServiceScope has not yet been set by DicomServerFactory::Create() before StartAsync() is called on the server.
To Reproduce
As above.
Expected behavior
An exception should not be thrown.
Screenshots or test DICOM files
If applicable, add screenshots or test DICOM files to help explain your problem.
* move assignment of ServiceScope to before call to StartAsync(), otherwise a client can connect between these calls and the connection will fail
* fixes#1398
Describe the bug
We have seen an exception being thrown when connecting to a DicomServer quickly after it is started.
In our case, we are starting a DicomServer that implements
DicomService
,IDicomServiceProvider
,IDicomCStoreProvider
andIDicomCEchoProvider
.Immediately after creation we use
echoscu.exe
to check the service is up. Frequently we get the following exception:Our debugging has shown this is caused by
DicomService (line 247)
trying to accessServiceScope.ServiceProvider
.ServiceScope
has not yet been set byDicomServerFactory::Create()
beforeStartAsync()
is called on the server.To Reproduce
As above.
Expected behavior
An exception should not be thrown.
Screenshots or test DICOM files
If applicable, add screenshots or test DICOM files to help explain your problem.
Environment
Fellow Oak DICOM version: 5.0.3
OS: Docker container running mcr.microsoft.com/dotnet/aspnet:6.0-alpine
Platform: .NET 6.0
The text was updated successfully, but these errors were encountered: