fo-dicom / fo-dicom-samples

Sample applications associated with the fo-dicom framework
Other
153 stars 143 forks source link

How to send CECHOResponse, After Receiving a CECHOREQUEST #75

Closed C-Sagar-Kumar closed 2 years ago

C-Sagar-Kumar commented 2 years ago

Hi, I am using below code to send the CECHOResponse but Its timing out, can you guide me what exactly I am missing in my below code.

Dicom.Network.Client.DicomClient dicomClient = CreateDicomVerificationClient(strIPAddress, port);
await dicomClient.SendAsync();

code log

gofal commented 2 years ago

you called "client.AddRequestAsync(dicomCEchoRequest);" without the "await". that means maybe the request is not ready added to the pipeline when you started sending the request.

C-Sagar-Kumar commented 2 years ago

Hi Reinhard, Thnx for you reply. I fixed the issue long back, actual issue was with the simulator which I was using for verification call testing is actually the SCP and I need to create and send as SCU. However, I tried as SCP only so its not able to connect to the SCU and sent the response as time out. I found out and resolved this and also what feedback you gave that also I found out and fixed since it was async call without await it will run synchronously and execute without waiting for completion of the thread. I forgot to update this communication thread after my fix sorry for that. Thanks for your reply and Have a great day.

gofal commented 2 years ago

thanks for your answer and how you fixed it.

C-Sagar-Kumar commented 2 years ago

As I told Since the simulator(which is the user/ ultrasound machine for me for testing) was the SCU, I created the SCP provider i.e. Created the custom class and implemented & inherited DicomService, IDicomServiceProvider, IDicomCStoreProvider, IDicomCEchoProvider, IDicomCFindProvider and then wrote the necessary logic as per my requirement then it resolved the issue. Lemme know If I can create a sample project for the same and upload into the fo-dicom-samples repo, so that it will be easy to implement for others, bcoz I faced so many issues while implementing the same since the solution/ samples we got from google is not straight forward. Therefore, I broke my head so much to get exact root cause and solution.

gofal commented 2 years ago

yes, sure. That would be great. A sample from a real live application is much better, that those rather test-only samples that are available now.