This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Installation and Configuration
Roman Baitaliuk edited this page Jan 19, 2018
·
10 revisions
ClusterWS-Client-Swift is compatible with CocoaPods. With CocoaPods, just add this to your Podfile:
pod 'ClusterWS-Client-Swift'
To connect to the server use ClusterWS
instance:
let webSocket = ClusterWS(url: "host", port: portNumber)
webSocket.delegate = self
webSocket.connect()
/**
autoReconnect: '{boolean} allow to auto-reconnect to the server on lost connection (default false)',
reconnectionIntervalMin: '{number} how often it will try to reconnect in seconds (default 1.0)',
reconnectionIntervalMax: '{number} how often it will try to reconnect in seconds (default 5.0)',
reconnectionAttempts: '{number} how many attempts, 0 means without limit (default 0)'
*/
webSocket.setReconnection(autoReconnect: true, reconnectionIntervalMin: 1.0, reconnectionIntervalMax: 5.0, reconnectionAttempts: 0)
💥 We would really appreciate if you give us stars ⭐ (on all our repositories):
For you to give the stars ⭐ is not hard, but for us, it is a huge motivation to work harder and improve the project. Thank you very much 😄.