LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No tcp connection in of tcp server

Solved!
Go to solution

I am trying to make labview program to replace a java program on a pc(192.168.1.88).

 

The first step is the program will start a tcp server, then a client(192.168.1.44) will connect in. The java program works fine, but my program all the time waiting and no connection in.

 

I tried wireshark. When java program receive the connection, it only give 4 lines, my program got many lines and no connection as attached.

 

Any suggestion, thank.

0 Kudos
Message 1 of 10
(2,771 Views)
There are example programs that demonstrate how to do this. Try those examples and then (assuming that they worked) compare you code to them to see where you went wrong.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 10
(2,761 Views)

I have followed the example.

 

I tried when both program run, the port 5001 will be open, and the client package will be arrive.

 

But only the java program will response.

 

The PC has 2 network interfaces with different subnet.

0 Kudos
Message 3 of 10
(2,755 Views)

Also, in the labview tcp server creation, I have specified the network interface.

 

This may be a bug.

0 Kudos
Message 4 of 10
(2,753 Views)

Post your code. I have not experienced any issues with the TCP servers written in LabVIEW and I use them quite often. Other things to look for are firewall settings. Make sure you are not blocking the port of the application.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 5 of 10
(2,731 Views)

I tried to connect from a local client. Both labview and java tcp server works. But if connect from remote, only java will work.

 

And the 2 interface is 192.168.1.88 and 172.16.5.95.

0 Kudos
Message 6 of 10
(2,724 Views)

netstat log as attached.

0 Kudos
Message 7 of 10
(2,722 Views)
Solution
Accepted by topic author alex.

Don't wire the net address. This is forcing it to only listen on the one interface. The Java code is listening on all interfaces and your LabVIEW code is only listening on the 192 interface. I suspect your remote PC is actually coming in on the other interface.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 8 of 10
(2,712 Views)

The pc has 2 network ports. The remote embedded device is also in 192 and is direct link

 

I tried no't wire the net address, but still not work.

 

Any suggestion, thanks.

0 Kudos
Message 9 of 10
(2,705 Views)

Showing some relevant section of the Java program source would probably help. Or from the client program. There might be a number of things. As to the wireshark log, all those entries in there are from many things, which could be in some ways related to LabVIEW but none but one line are related to your actual problem. And looking at your example you posted later, you should not let the listen socket get closed right away. Think dataflow!Another recommendation since you are not using the address information anyhow, set the resolve remote address to false. It could add a huge delay accepting the incoming connection request, since it will cause a name resolution request on your network which will possibly timeout because of no DNS server being available, and even if you have a DNS server it is not clear if it will contain a name record for that device.

Rolf Kalbermatter
My Blog
Message 10 of 10
(2,673 Views)