LabWindows/CVI

Content Type
Programming Language
Current manual

Writing TCP Applications on Multihomed Hosts

When writing TCP applications, your host machine might have multiple network interfaces, including network cards, adapters, and so on, that might be connected to the same or multiple networks. In these cases, the host machine is said to be multihomed. If you are writing a TCP server program on a multihomed host, then National Instruments recommends that you call RegisterTCPServerEx instead of RegisterTCPServer. Using RegisterTCPServerEx, you specify the IP address of the network interface to use on the local host for the server, whereas RegisterTCPServer uses the network interface configured as the default interface in your system. You can use the Network Connections applet of the Windows Control Panel to change the default interface. Call the LabWindows/CVI TCP Support Library GetAllTCPHostAddresses function to get the IP addresses of all the network interfaces on your local machine.

If you are writing a TCP client program on a multihomed host, you cannot specify the network interface to use for the connection in the LabWindows/CVI TCP Support Library. The network routing tables configured on your host machine restrict this choice. However, you can use the low-level Windows command-line utility program called route to change the routing tables and control the network interface to use for connecting to a particular server.

Was this information helpful?

Log in to get a better experience

Help us improve your future ni.com experience.

What are you trying to do?

Submit