Well,

since you would still have to hit the server to verify if you can connect or not, I would suggest to go with the LightstreamerClient connection, then listen for the DISCONNECTED* events and...