File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public class PusherConnection {
24
24
public weak var stateChangeDelegate : ConnectionStateChangeDelegate ?
25
25
public var reconnectAttemptsMax : Int ? = 6
26
26
public var reconnectAttempts : Int = 0
27
- public var maxReconnectGapInSeconds : Int ? = nil
27
+ public var maxReconnectGapInSeconds : Double ? = nil
28
28
private var reconnectTimer : NSTimer ? = nil
29
29
internal var reconnectOperation : NSOperation ?
30
30
@@ -671,11 +671,11 @@ public class PusherConnection {
671
671
*/
672
672
@objc internal func attemptReconnect( ) {
673
673
if connectionState != . Connected {
674
- if ( reconnectAttemptsMax == nil || ( reconnectAttemptsMax != nil && reconnectAttempts < reconnectAttemptsMax) ) {
674
+ if ( reconnectAttemptsMax == nil || reconnectAttempts < reconnectAttemptsMax) {
675
675
connect ( )
676
676
reconnectAttempts += 1
677
677
let reconnectInterval = Double ( reconnectAttempts * reconnectAttempts) * 2.0
678
- let timeInterval = maxReconnectGapInSeconds != nil ? max ( reconnectInterval, Double ( maxReconnectGapInSeconds!) )
678
+ let timeInterval = maxReconnectGapInSeconds != nil ? max ( reconnectInterval, maxReconnectGapInSeconds!)
679
679
: reconnectInterval
680
680
reconnectTimer = NSTimer . scheduledTimerWithTimeInterval (
681
681
timeInterval,
You can’t perform that action at this time.
0 commit comments