I have implemented a socket cluster server. Also have an android app that is using it and the connection is very stable and data exchange is also good.I have a spring server as well and that also works absolutely fine. When implementing socket cluster on IOS i.e. its swift client im facing issue during re-connection. After socket disconnects, re-connection is not working. I cant see any function that has a re-connection policy, not only that on disconnection the library internally is not calling the connect function either. What is the right way to solve this issue.
public func setBasicListener(onConnect : ((ScClient)-> Void)?, onConnectError : ((ScClient, Error?)-> Void)?, onDisconnect : ((ScClient, Error?)-> Void)?) {
self.onConnect = onConnect
self.onDisconnect = onDisconnect
self.onConnectError = onConnectError
}
public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
onDisconnect?(self, error)
}
Even on onConnectError there is no function that triggers the connect.