how to handle connection lost

Hello. I want to handle connection lost, but can’t catch any signal… What should I check to see if the connection is lost or normal?