socket update

Deal with some problem while socket was closed.