when websocket closed the app closed

when websocket closed the app closed to the top view, how to catch it?