LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between ConnectToTCPServer and ConnectToTCPServerEx

Hi everyone,

 

I am looking at the CVI help information for the functions ConnectToTCPServer and ConnectToTCPServerEx and I cannot find much difference except that the latter has a note to let the function select the default port.  Is there any other significant difference between the two?

 

I am planning to use these functions to connect to devices that my company makes that are accessible via our network.  These devices have Ethernet ports with third party modules that allows the devices to have an IP address.  Essentially, our devices are servers, but do not use the CVI TCP functions on the server end.  Will this cause me problems for connecting and retrieving data?

 

Thank you,

 

Judy

0 Kudos
Message 1 of 3
(3,632 Views)

Hi Judy.

 

The ability to specify the client (local) port appears to be the only difference.

 

According to this article:

Explicitly Specifying a Client Port


Unlike TCP servers, it is not necessary for TCP clients to explicitly specify or register a port for the connection. However, because of the presence of network firewalls and so on, you might want to specify the local host port the client program uses to establish a connection to the TCP server. To specify the client port, you must use the ConnectToTCPServerEx function, which includes the clientPort parameter. This parameter is different from the serverPort parameter, which you must specify correctly no matter which function you use. If you specify the client port explicitly, you must make sure that other TCP programs are not using that client port. National Instruments recommends that you not explicitly specify the client port unless it is necessary to use a specific client port. Use TCP_ANY_LOCAL_PORT if you do not need to specify the client port explicitly.

 

Regards,

Colin.

 

Message Edited by cdk52 on 02-18-2009 10:26 AM
0 Kudos
Message 2 of 3
(3,619 Views)

Hi Colin,

 

Thanks for the info and the link!

 

Judy

0 Kudos
Message 3 of 3
(3,606 Views)