Put connectToServer() on a different thread.