Implement configurable reconnect duration

Sometimes (e.g. in tests) there is no need to wait for 2 seconds to reconnect (e.g. 1 sec is enough).