auto reconnect for socket