check if socket disconnected
fine tuned connection judgement