An on-line procedure in discounted infinite-horizon stochastic optimal control