06-22-2023 08:02 AM
My project is working as intended on local host (hosting the server and client on the same computer). When I try putting the client on another computer I connect and read/write information as intended. The issue is the server and client randomly disconnect anywhere from 10-20 seconds into connection. The server and client should both have run through all case structures by this point as they have sent and received data. I'm lost on why the connection drops. If anyone has any tips or advice on how to troubleshoot/ common issues I would appreciate it.
06-22-2023 08:49 AM
We cannot troubleshoot words.
Since you say "connection", I assume you are using TCP, not UDP (both are part of TCP/IP). Do you know which side disconnects? Do you get any error messages? Are both sides on the same subnet or is the connection goring rough routers (or even NAT).
Can you explain the "case structures" on each side? What kind of data is passed around (size, etc.). Seeing some code would help. What kind of errors do you get?
06-22-2023 09:02 AM
You're correct it is TCP, using subnet. There are no errors whatsoever. My client gets disconnected by the server, and my guess is it actually gets interrupted by some timing issue. I was thinking about using a simple error handler to help troubleshoot, so I know what state it gets disconnected in, but I'm new to LabVIEW and not sure how to go forward with that idea.
06-22-2023 09:12 AM
If you are new to LabVIEW, we definitely need to see your code, because there could be race conditions that are masked due to slight changes in execution order if doing things via internal loopback.
Are any connection wires branched? Are there any output tunnels not wired in all cases (using default if unwired)?
06-22-2023 01:40 PM
@helpwanted wrote:
You're correct it is TCP, using subnet. There are no errors whatsoever. My client gets disconnected by the server, and my guess is it actually gets interrupted by some timing issue. I was thinking about using a simple error handler to help troubleshoot, so I know what state it gets disconnected in, but I'm new to LabVIEW and not sure how to go forward with that idea.
The nice thing about TCP/IP is you can always see everything that is going on (on the local connection), including who is closing the connection. All you have to do is learn how to use this tool:
As far as what to do on the LabVIEW side, you should make a generic TCP client class object in which you can build in all your network test tools. After you have a nice TCP client class you can use it for all your other projects that need a TCP client connection.