How to set the number of reconnections on connection lost? Currently it seems that the client will keep reconnecting...