The EchoSCU example demonstrates how to use DCF to create a VerificationSCU and perform a C-Echo to a VerificationSCP.
Classes
Class | Description | |
---|---|---|
Program |
A simple echo client example that shows how to do a DICOM ping. This program should be run with a Verification SCP running on localhost listening on port 104 by default.
|
Examples
EchoSCU Sample Code
public class Program { /// <summary> /// Main entry point for EchoSCU. /// </summary> [STAThread] public static void Main() { Console.Title = "LaurelBridge.DCF.Examples.EchoSCU"; try { VerificationSCU scu = new VerificationSCU("SCU", new DicomAddress("localhost", 104, "SCP")); scu.RequestAssociation(); // do a DICOM ping with a 30 second timout CEchoResponse response = scu.CEcho(30); scu.ReleaseAssociation(); Console.WriteLine("c-Echo returned {0}", response.Status); } catch (Exception e) { Console.WriteLine("Exception caught during execution: {0}{1}{1}Please verify the Verification SCP is up and running.", e, Environment.NewLine); } if (System.Diagnostics.Debugger.IsAttached) { Console.Write("Press any key to continue . . . "); Console.ReadKey(); } }