Bobillier Posted June 6, 2023 Report Share Posted June 6, 2023 In the context of a Tcp communication, I would like to know if, in case of a loss of this one, it is mandatory to close the connection before reopening it in order to release the resources, or the fact that the reference becomes invalid is sufficient-it to release it automatically at the PC level. I ask for this, because in my project, communication has to remain active for several months and it has to reconnect itself to maintain the service. Quote Link to comment
Rolf Kalbermatter Posted June 15, 2023 Report Share Posted June 15, 2023 (edited) It depends what was the reason of the loss. If the connection got lost because the remote side disconnected, then yes you absolutely SHOULD close your side of the connection too. Otherwise that refnum will reserve resources, for one for itself, as well as the underlying socket which also needs to be explicitly closed. So when in doubt ALWAYS close LabVIEW refnums explicitly through the proper close node even if the underlying resource has been somehow invalidated. The only time you do not need to do that is if the refnum got autoclosed because the top level VI in whose hierarchy the refnum was created got idle. Edited June 16, 2023 by Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.