Showing results for 
Search instead for 
Did you mean: 

TCP cannot close the connection when the number of received bytes exceeds the set number of reads

Use TCP Assistant (TCP Client) to send data to LabVIEW (TCP Server), the "TCP Read" module is configured as "Standard", the number of bytes is 8, and the timeout is 500 milliseconds. The function is to close the connection when the 8-byte data is received or it times out. During the test, I used the TCP Client to send 9 bytes of data to LabVIEW. "TCP Read" output the first 8 bytes of data and ran "TCP Close Connection" backward, but the connection of the TCP assistant was not closed, why was the connection not closed ?

0 Kudos
Message 1 of 6

Why don't you attach your code so we can (a) see what you actually did, (b) determine which version of LabVIEW you are using, (c) try your code ourselves, possibly making some changes or putting probes in to understand what is actually happening (all these things, of course, you could do, yourself)?  The more help you give us, the more help (and more accurate help) we can give you.


Be sure to attach all the relevant code!


Bob Schor

0 Kudos
Message 2 of 6

Besides of what Bob already mentioned, your terminalogy is pretty confusing;: Never heard of a TCP Assistent before. This together with the somewhat unclear description of what you actually tried makes it simply impossible to even try to replicate it, so we can’t possibly help you!

Rolf Kalbermatter
DEMO, TU Delft
My Blog
0 Kudos
Message 3 of 6

This is a block diagram. When the number of bytes received is> 8, the TCP Client will not be closed. Why?123.png

0 Kudos
Message 4 of 6

Don't attach a tiny picture we can't even look at.


Attach the actual VI!

0 Kudos
Message 5 of 6

Bob asked for the VI not a picture! And if you are at it, don’t post VIs in the greatest and latest LabVIEW version, not everyone has the possibility to install that on the work machine. There is a menu Save.. and in the dialog a selection to save for previous version, then save at least two version before and then create a ZIP file if there are multiple VIs and attach that.


However your description makes no sense at all as that VI you show a picture of never ever can terminate. The loop has a False wired to the termination terminal and therefore never will terminate (and the Close never ever will get executed for the connections, accumulating them until Windows will stop doing any TCP communication when there are about 1000 connections ons open!

Rolf Kalbermatter
DEMO, TU Delft
My Blog
0 Kudos
Message 6 of 6