fixed: does not detect the socket closed.