Correctly pass both host and port variables everywhere in the unit tests.
Use the current loop in the connection reconnect code.