Fix bug on server closed socker unexpectedly