Skip to content

Commit 0b09a13

Browse files
committed
use didset instead of computed variable
1 parent e8dfe58 commit 0b09a13

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

SocketIOClientSwift/SocketEngine.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient {
4242
private var forceWebsockets = false
4343
private var pingInterval:Int?
4444
private var pingTimer:NSTimer?
45-
private var pingTimeout = 0
46-
private var pongsMissed = 0
47-
private var pongsMissedMax:Int {
48-
return pingTimeout / (pingInterval ?? 25)
45+
private var pingTimeout:Int = 0 {
46+
didSet {
47+
pongsMissedMax = pingTimeout / (pingInterval ?? 25)
48+
}
4949
}
50+
private var pongsMissed = 0
51+
private var pongsMissedMax = 0
5052
private var postWait = [String]()
5153
private var _polling = true
5254
private var probing = false

0 commit comments

Comments
 (0)