Added a reconnection delay and more logging to the client thread.