timeout listener added

timeout listener added to check the connection is still alive, now reconnection is working