improve async loop, fix socket bug;