close socket when done sending