danielrhodes / Swift-ActionCableClient

ActionCable is a new WebSocket server being released with Rails 5 which makes it easy to add real-time features to your app. This Swift client makes it dead-simple to connect with that server, abstracting away everything except what you need to get going.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

disconnected and reconnect

chakery opened this issue · comments

let client = ActionCableClient(URL: NSURL(string: "ws://localhost:3000/cable")!)
client.onDisconnected = { [weak self] error in
    print(error)
}

when I got the below error message on Disconnected callback, that client don't reconnect.

ActionCableClient.ConnectionError.unknownDomain(Error Domain=WebSocket Code=2 "write wait timed out" UserInfo={NSLocalizedDescription=write wait timed out})

how should I make it reconnect?