Rework socket connection handling in clock sync