Exits when server disconnected.