in reply to Restarting a script without dropping clients

"I had the problem initially of it not being able to reopen the port... fixed that by having a second script do the actual restarting of the script... "

To ensure that you can reopen port right the way, add this when you create socket:

reuse => 1

Maybe you should rethink what you are trying to do, whether you are using a canon to kill a fly?