LEADTOOLS Medical (Leadtools.Dicom assembly)
LEAD Technologies, Inc

Listen(String,Int32,Int32,DicomNetIpTypeFlags) Method








The IP address of the host computer (the SCP's address).
The port number of the host computer (the SCP's port).
Backlog parameter.
The type of ip address supported (IPv4, IPv6, or both)
Establishes a connection for listening for incoming connection requests. .NET support WinRT support
Syntax
public void Listen( 
   string hostAddress,
   int hostPort,
   int maxNumberOfPeers,
   DicomNetIpTypeFlags ipType
)
'Declaration
 
Public Overloads Sub Listen( _
   ByVal hostAddress As String, _
   ByVal hostPort As Integer, _
   ByVal maxNumberOfPeers As Integer, _
   ByVal ipType As DicomNetIpTypeFlags _
) 
'Usage
 
Dim instance As DicomNet
Dim hostAddress As String
Dim hostPort As Integer
Dim maxNumberOfPeers As Integer
Dim ipType As DicomNetIpTypeFlags
 
instance.Listen(hostAddress, hostPort, maxNumberOfPeers, ipType)
public void Listen( 
   string hostAddress,
   int hostPort,
   int maxNumberOfPeers,
   DicomNetIpTypeFlags ipType
)
ObjectiveC Syntax
 function Leadtools.Dicom.DicomNet.Listen(String,Int32,Int32,DicomNetIpTypeFlags)( 
   hostAddress ,
   hostPort ,
   maxNumberOfPeers ,
   ipType 
)
public:
void Listen( 
   String^ hostAddress,
   int hostPort,
   int maxNumberOfPeers,
   DicomNetIpTypeFlags ipType
) 

Parameters

hostAddress
The IP address of the host computer (the SCP's address).
hostPort
The port number of the host computer (the SCP's port).
maxNumberOfPeers
Backlog parameter.
ipType
The type of ip address supported (IPv4, IPv6, or both)
Remarks

If hostAddress is an empty string or a null reference (Nothing in Visual Basic), the IP address will be the local computer's address.

If hostAddress is "*", the IP address will be all of the local computer's addresses. This is useful if the local computer has more than one network interface and address.

If hostPort is 0, the port number will be the number of the first available port.

The maxNumberOfPeers parameter is the value passed to the WinSock listen() function for the backlog parameter that limits the size of the queue for waiting connections. As an example, suppose that the value is set to 3 and that 4 people try to connect at exactly the same time. In such a case, all 4 will be rejected because the connection backlog queue is full. But if one of the connections has been accepted by the time the 4th is made, then all will work.

To determine how many clients are connected and impose a limit on the number of connections, perform the following steps:

  1. Use the DicomNet.GetClientCount function in the "OnReceiveAssociateRequest" handler.
  2. Compare that value with the maximum number of connections allowed.
  3. If the number of clients connected is greater than the maximum number of connections allowed, send a "SendAssociateReject" command to the client trying to connect.

To connect to a server as a client, you must first create and initialize a DicomNet object. Then call Connect(String,Int32,String,Int32) to establish the connection.

To use your computer as an SCP, you must first create a DicomNet object. Then call Listen(String,Int32,Int32) to listen for incoming connection requests.

This overload of the DicomNet.Connect method allows you to specify which type of Internet Protocol Version to use. Pass DicomNetIpTypeFlags.Ipv4 for ipType to support the Internet Protocol version 4 (IPv4), which is the standard "dotted quad" 32-bit address format that has been in use since 1981. An example of an IPv4 address is 192.168.0.195

Pass DicomNetIpTypeFlags.Ipv6 for ipType to support Internet Protocol Version 6 (IPv6). IPv6 uses a 128-bit address format. An example of an IPv6 address is fe80::18bd:81f:6b02:759f

To support both IPv4 and Ipv6 addresses, pass DicomNetIpTypeFlags.Ipv4OrIpv6 for ipType.

If the call to Connect(String,Int32,String,Int32) fails, make sure that the IP address passed for hostAddress is a valid address accessible within your network. You can verify the accessibility of both IPv4 and IPv6 addresses using the Windows ping command. For example, to verify that 192.168.0.195 is accessible within your network, perform the following steps:

Note that the following are equivalent:

Example
For an example, refer to DicomNetIpTypeFlags.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DicomNet Class
DicomNet Members
Overload List
Startup Method
Connect(String,Int32,String,Int32) Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Dicom requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features