Suggestion from <alan_g>: so, a possibly simpler solution would be an atexit handler that deletes the socket?
Suggestion from <alan_g>: so, a possibly simpler solution would be an atexit handler that deletes the socket?