v2. Added user option to specify function run by reconnect timer. Factored out reconnect scheduling for use in user code.