Hi, there is no explicit notice that the Server is down, as the library just keeps trying to reconnect.
Hence, you should check for the CONNECTING state.
The logic of the state transitions is explained
here.
The STALLED state indicates that the connection is silent and may be the first signal that the Server has gone down. But, also in that case, a notification of the state switching to CONNECTING would follow.