close socket after shutdown