fix hung_up error on closed socket