LEADTOOLS Medical (Leadtools.Dicom assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Connect(String,Int32,String,Int32,DicomNetIpTypeFlags) Method
See Also 
Leadtools.Dicom Namespace > DicomNet Class > Connect Method : Connect(String,Int32,String,Int32,DicomNetIpTypeFlags) Method



hostAddress
The IP address of the host computer (the SCP's address).
hostPort
The port number of the host computer (the SCP's port).
peerAddress
The IP address of the peer computer to which to connect (the SCU's address).
peerPort
The port number of the peer computer to which to connect (the SCU's port).
ipType
The type of ip address supported (IPv4, IPv6, or both)
hostAddress
The IP address of the host computer (the SCP's address).
hostPort
The port number of the host computer (the SCP's port).
peerAddress
The IP address of the peer computer to which to connect (the SCU's address).
peerPort
The port number of the peer computer to which to connect (the SCU's port).
ipType
The type of ip address supported (IPv4, IPv6, or both)
Connects an SCU to an SCP.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub Connect( _
   ByVal hostAddress As String, _
   ByVal hostPort As Integer, _
   ByVal peerAddress As String, _
   ByVal peerPort As Integer, _
   ByVal ipType As DicomNetIpTypeFlags _
) 
Visual Basic (Usage)Copy Code
Dim instance As DicomNet
Dim hostAddress As String
Dim hostPort As Integer
Dim peerAddress As String
Dim peerPort As Integer
Dim ipType As DicomNetIpTypeFlags
 
instance.Connect(hostAddress, hostPort, peerAddress, peerPort, ipType)
C# 
public void Connect( 
   string hostAddress,
   int hostPort,
   string peerAddress,
   int peerPort,
   DicomNetIpTypeFlags ipType
)
C++/CLI 
public:
void Connect( 
   String^ hostAddress,
   int hostPort,
   String^ peerAddress,
   int peerPort,
   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).
peerAddress
The IP address of the peer computer to which to connect (the SCU's address).
peerPort
The port number of the peer computer to which to connect (the SCU's port).
ipType
The type of ip address supported (IPv4, IPv6, or both)

Example

For an example, refer to DicomNetIpTypeFlags.

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 hostPort is 0, the port number will be the number of the first available port. In most cases, you should pass 0 for this parameter. If you pass any port number other than 0, that port number will be used for the first connection and when you close the connection, LEADTOOLS will wait for the internal TCP timeout before releasing the port. This may lead to problems reconnecting. If you pass 0, then on subsequent connections LEADTOOLS will use the next available port.

To connect to an SCP as an SCU, you must first create 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 Leadtools.Dicom.DicomNet.Listen to listen for incoming connection requests.

When an SCU calls this method, it generates a call to OnAccept on the SCP.

This overload of the DicomNet.Connect method allows you to specify the 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 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 that you passed for hostAddress is a valid address that is 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, do the following

  • Start command prompt, and type the following command
  • ping 192.168.0.195

Note that the following are equivalent:

  • Connect( hostAddress, hostPort, peerAddress, peerPort);
  • Connect( hostAddress, hostPort, peerAddress, peerPort, DicomNetIpTypeFlags.Ipv4);

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

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