DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomAssociation Class / Echo Method
Example

In This Topic
    Echo Method (DicomAssociation)
    In This Topic
    Sends a verification request (C-ECHO) over a "stand-alone" DicomAssociation and returns the result
    Syntax
    'Declaration
     
    
    Public Function Echo() As System.Integer
    public System.int Echo()

    Return Value

    Integer
    Remarks

    DicomAssociation must be open before sending out C-ECHO request.

    Although in theory the remote entity may return a status other than 0 to indicate an error, in most circumstances (such as remote machine turned off), this method will fail with a trappable error, such as "Fail to connection at TCP level".

    The C-ECHO status can also be found in the LastStatus property of DicomAssociation.

    For more details of sending C-ECHO via TLS, see Echo method of DicomGlobal object.

    Example
    using DicomObjects;
    using DicomObjects.DicomUIDs;
                	    
       using (var cn = new DicomAssociation()) {       
           cn.RequestedContexts.Add(SOPClasses.Verification);
           cn.Open("localhost", 104, "callingAET", "calledAET");
           
           // Echo() returns 0 if C-Echo succeeds.
           int echoStatus = cn.Echo();
           if (echoStatus == 0) 
           {
               // Success
           } 
           else
           {
               // Unsuccessful
           }
           cn.Close();
       }
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also