Use callback to initialize client connection.
Prevent falsely reporting connected to server.
Reconnect to server when disconnected.