This program is logging phone calls in real time over ethernet, so I could be waiting from 1 sec to 5 hours for more output on the socket, depending on whether anybody calls or not. I will lower the timeout, though. Maybe I'll try 7200sec (2 hours)
I explained the problem poorly - the script doesn't actually "die" - it's still running, just not logging the output anymore, and if I try to telnet to my device at the port that my script is supposed to be listening to, I am refused - so I know the socket is still open.