LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple TCP Connection Problems

I am trying to connect two computers via TCP. I am using CVI 7.1.1.
I have them connected via a known good crossover cable.
On the computer that I am running the server I have the IP address manually configured as 10.1.1.1.
I then initiate the sample TCP server application and choose a port number as 4000.
The server initiates properly and in the panel indicates the proper IP address of 10.1.1.1.
I then try to initiate the client application on the other computer. I type in the address
as 10.1.1.1 and the port number of 4000, but when attempting to connect to the server
a popup message indicates that the 'Connection to server failed.'
Is there anything in the process that I am missing which would cause this failure.
I have gone through all the feedback on this website and cannot find any
information which would indicate that I am doing anything wrong.
 
Any help is appreciated.
 
 
0 Kudos
Message 1 of 6
(3,748 Views)
The first programs I wrote which used TCP suffered from a similar problem. The solution was suggested to me by a colleague with more network knowledge: do not manually assign IP addresses. Let the operating system (we used XP) do this for you automatically. Instead, use the remote computer name (that is known on the common network workgroup) in place of the IP address in the call to ConnectToTCPServer().
 
JR
0 Kudos
Message 2 of 6
(3,727 Views)

You might also need to ensure that the firewalls on the computers are turned off. IIRC, ports numbered 49152 and above are commonly reserved for private use.

JR

0 Kudos
Message 3 of 6
(3,721 Views)

TestGuy,

Make sure the client and server are running on the same subnet.  I.e. if you have a subnet mask of 255.255.255.0 and a server with the IP address 10.1.1.1 then your client must have an IP address of 10.1.1.n.

0 Kudos
Message 4 of 6
(3,674 Views)
Also, try using ping to make sure the client can actually see the server and vice versa.

Bilal Durrani
NI
0 Kudos
Message 5 of 6
(3,648 Views)

For anyone that might be going through these messages. I found the solution to my problem was to make the static IP addresses in the range 192.168.x.y. I was trying to connect two computers running Windows XP Home edition. I think the problem lies in the fact that the Home edition does not recognize all of the reserved private IP addresses that are recognized by Windows XP Pro. Anyways, once I changed the static IP addresses everything worked as expected.

 

 

0 Kudos
Message 6 of 6
(3,557 Views)