From 1e96d7982d3c5bb195d3ff1f439f26261192520c Mon Sep 17 00:00:00 2001 From: jtjacka Date: Thu, 25 Feb 2016 16:06:08 -0800 Subject: [PATCH] fix timeoutAfter handler always close connection --- Source/SocketIOClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SocketIOClient.swift b/Source/SocketIOClient.swift index 8da6690..d3a0b36 100644 --- a/Source/SocketIOClient.swift +++ b/Source/SocketIOClient.swift @@ -169,7 +169,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeoutAfter) * Int64(NSEC_PER_SEC)) dispatch_after(time, handleQueue) {[weak self] in - if let this = self where this.status != .Connected || this.status != .Closed { + if let this = self where this.status != .Connected && this.status != .Closed { this.status = .Closed this.engine?.disconnect("Connect timeout")