# Problems with tcpConnections in URScript

**URL:** <https://forum.universal-robots.com/t/problems-with-tcpconnections-in-urscript/23288>\
**Category:** Technical Questions\
**Created:** [August 16, 2022, 11:35am UTC](https://forum.universal-robots.com/t/problems-with-tcpconnections-in-urscript/23288 "2022-08-16T11:35:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon38581660](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@anon38581660](https://forum.universal-robots.com/u/anon38581660)\
**Post date:** [August 16, 2022, 11:35am UTC](https://forum.universal-robots.com/t/problems-with-tcpconnections-in-urscript/23288/1 "2022-08-16T11:35:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![terryc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/terryc/32/3006_2.png) [@terryc](https://forum.universal-robots.com/u/terryc)\
**Post date:** [August 16, 2022, 11:51pm UTC](https://forum.universal-robots.com/t/problems-with-tcpconnections-in-urscript/23288/2 "2022-08-16T23:51:35Z")

</div>

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

> [@When socket\_close() is called?](https://forum.universal-robots.com/t/when-socket-close-is-called/3368/2):
>
> When a program using sockets is stopped, all remaining open sockets are closed. However it is good practice, to use socket\_close() yourself to ensure proper housekeeping.
