Merge pull request #317 from jtjacka/master

fix timeoutAfter handler always close connection
This commit is contained in:
Erik Little 2016-02-25 19:11:33 -05:00
commit 11c0ac249b

View File

@ -169,7 +169,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeoutAfter) * Int64(NSEC_PER_SEC)) let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeoutAfter) * Int64(NSEC_PER_SEC))
dispatch_after(time, handleQueue) {[weak self] in 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.status = .Closed
this.engine?.disconnect("Connect timeout") this.engine?.disconnect("Connect timeout")