Server reconnect logic