While implementing a C-Echo request everything works as planned when the response is a success. However, when the Remote AE rejects the association, the OnResponseReceived does not capture the event. The only way I know the association was rejected is by looking in the logs. (I'm using FO version 2.0.2)
2016-12-02 12:05:12.5556|INFO|Dicom.Network|PACSARCH <- Association reject [result: Permanent; source: ServiceUser; reason: CallingAENotRecognized]
2016-12-02 12:05:12.5868|ERROR|Dicom.Network|Exception processing PDU: {0}
2016-12-02 12:05:12.5868|ERROR|Dicom.Network|Connection closed with error: {0}
Here is my relevant code: (Sorry for the VB.net)
Dim cEcho = New DicomCEchoRequest() With { _
.OnResponseReceived = AddressOf returnedEcho}
Dim cEchoClient = New Dicom.Network.DicomClient()
With cEchoClient
.Options = New DicomServiceOptions()
With .Options
.TcpNoDelay = False
End With
.Linger = 200
.NegotiateAsyncOps()
End With
cEchoClient.AddRequest(cEcho)
cEchoClient.Send(sRemoteIP, sRemotePort, False, sLocalAE, sRemoteAE)
Private Sub returnedEcho(request As DicomCEchoRequest, response As DicomCEchoResponse)
Console.WriteLine("Returned Status " & response.Status.Description)
MessageBox.Show("Result: " & response.Description,
"Dicom Verify", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Also, can anyone comment on the correct usage of the DicomClient options. Like "Linger" and "TcpNoDelay".
Thanks for any insight....
DW