Saving host and port on socket and the server so they can be changed beween attempts.