close socket after done