Problems with tcpConnections in URScript

Hi,
I am using the Polyscope to create a custom program for a UR10e and I have a few questions about stability and proper handling of the tcp connection.
There are a few problems with the starting/ending and the behavior of the connection. After a disconnect, the URScript/client side sometimes does not reconnect to the server. I am detecting disconnection with the receiving of an empty string followed by socket_close and later reopening the connection with socket_open.
The Polyscope program is in the loop of reconecting but it is not registered by the server until restart of the client program. Is there something that I could do to avoid this problem?

The script manual isn’t super clear on this hey. I did find this comment: