centrifugal / centrifuge-swift

Swift client SDK for bidirectional real-time communication with Centrifugo and Centrifuge-based server over WebSocket
MIT License
47 stars 41 forks source link

Connection error event? #16

Closed danqing closed 1 year ago

danqing commented 4 years ago

I am debugging a connection issue and I noticed that there's no event whatsoever when the connection is not succeeding.

My code is almost the same as in README:

let client = CentrifugeClient(url: url, config: CentrifugeClientConfig(), delegate: CentrifugeDelegate())
client.setToken(self.token)
client.connect()

... where CentrifugeDelegate has the onConnect and onDisconnect methods.

What happens is that the code gets executed, it's not connected to the server (log_level=debug doesn't show anything), and neither of the two methods are called. Basically, nothing happens.

I think it is useful both for debugging and for notifying the users that there's some delegate method, error or something else that gets triggered when the initial connection fails.

FZambia commented 4 years ago

Thanks, I suppose we can add onError delegate method that will report connection errors like this.

danqing commented 2 years ago

Hi @FZambia! It's been quite a while — is this something we can have soon? Thank you! :)

FZambia commented 1 year ago

All protocol features existing at this point were supported in 0.5.0.