reconnect to the server when the server faild.