From ff0f1c8c7718f3fe78a8f2f90c361e48ef49e31a Mon Sep 17 00:00:00 2001 From: Erik Little Date: Wed, 8 Nov 2017 08:17:36 -0500 Subject: [PATCH 1/2] Fix #855 --- Source/SocketIO/Engine/SocketEngine.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/SocketIO/Engine/SocketEngine.swift b/Source/SocketIO/Engine/SocketEngine.swift index 64bf370..13f36d6 100644 --- a/Source/SocketIO/Engine/SocketEngine.swift +++ b/Source/SocketIO/Engine/SocketEngine.swift @@ -563,8 +563,11 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll pongsMissed += 1 write("", withType: .ping, withData: []) - engineQueue.asyncAfter(deadline: DispatchTime.now() + .milliseconds(pingInterval)) {[weak self] in - self?.sendPing() + engineQueue.asyncAfter(deadline: DispatchTime.now() + .milliseconds(pingInterval)) {[weak self, id = self.sid] in + // Make sure not to ping old connections + guard let this = self, this.sid == id else { return } + + this.sendPing() } } From 45af5d96d99165b97df1cec972a282b10db93b72 Mon Sep 17 00:00:00 2001 From: Erik Little Date: Wed, 8 Nov 2017 08:25:57 -0500 Subject: [PATCH 2/2] bump version --- README.md | 4 ++-- Socket.IO-Client-Swift.podspec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eb89fde..be9e4bb 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Then import `import SocketIO`. ### Carthage Add this line to your `Cartfile`: ``` -github "socketio/socket.io-client-swift" ~> 12.1.2 # Or latest version +github "socketio/socket.io-client-swift" ~> 12.1.3 # Or latest version ``` Run `carthage update --platform ios,macosx`. @@ -107,7 +107,7 @@ Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`: use_frameworks! target 'YourApp' do - pod 'Socket.IO-Client-Swift', '~> 12.1.2' # Or latest version + pod 'Socket.IO-Client-Swift', '~> 12.1.3' # Or latest version end ``` diff --git a/Socket.IO-Client-Swift.podspec b/Socket.IO-Client-Swift.podspec index 632c10f..5df5bf7 100644 --- a/Socket.IO-Client-Swift.podspec +++ b/Socket.IO-Client-Swift.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Socket.IO-Client-Swift" s.module_name = "SocketIO" - s.version = "12.1.2" + s.version = "12.1.3" s.summary = "Socket.IO-client for iOS and OS X" s.description = <<-DESC Socket.IO-client for iOS and OS X. @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", - :tag => 'v12.1.2', + :tag => 'v12.1.3', :submodules => true } s.pod_target_xcconfig = {