To perform a TCP connection, you will need to open a TCP port. Thus, your connection may time-out or you've finished to use the TCP connection. In both cases, you always need to close the TCP port, even if the connection has timed-out. This will release some memory or re-initialize some variables in the system. Otherwise, you may have reached the limit of opens that the system allows you and you will loop for ever while trying to open another TCP port.