in reply to Maintain TCP client connection to server?
If you are writing to a disconnected stream socket then you will get a SIGPIPE which you can be trapped like:
You can put any code you want to reconnect and retry the send.$SIG{PIPE} = sub { print "WHoah got disconnected" };
/J\
|
|---|