Close socket after joining the system