DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomServer Class / Listen Method / Listen(Int32) Method

The TCP port on which to receive connections

Example

In This Topic
    Listen(Int32) Method
    In This Topic
    Open a TCP port to listen for incoming DICOM Connections
    Syntax
    'Declaration
     
    
    Public Overloads Sub Listen( _
       ByVal Port As System.Integer _
    ) 
    public void Listen( 
       System.int Port
    )

    Parameters

    Port

    The TCP port on which to receive connections

    Remarks

    More than one port may be active simultaneously. The listening sockets are all closed when the control is de-activated.

    Example
    DicomServer server = new DicomServer();
                
    // Handle incoming DICOM association requests
    server.AssociationRequest += (sender, e) =>
    {
        Console.WriteLine($"Incoming DICOM association request from {e.Association.CallingAET}");
    };
                
    int port = 104;
    server.Listen(port);
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also