close socket on no wifi