close socket in reopen()