From 0579e7ec19ff4614bbaa0ccacb2b297eacd12f48 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 21 Oct 2015 15:16:22 -0400 Subject: [PATCH] always set a session --- README.md | 6 +++--- Socket.IO-Client-Swift.podspec | 4 ++-- SocketIOClientSwift/SocketEngine.swift | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a50393c..69ed99c 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Carthage ----------------- Add this line to your `Cartfile`: ``` -github "socketio/socket.io-client-swift" ~> 4.0.2 # Or latest version +github "socketio/socket.io-client-swift" ~> 4.0.3 # Or latest version ``` Run `carthage update --platform ios,macosx`. @@ -83,7 +83,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! -pod 'Socket.IO-Client-Swift', '~> 4.0.2' # Or latest version +pod 'Socket.IO-Client-Swift', '~> 4.0.3' # Or latest version ``` Install pods: @@ -111,7 +111,7 @@ CocoaSeeds Add this line to your `Seedfile`: ``` -github "socketio/socket.io-client-swift", "v4.0.2", :files => "SocketIOClientSwift/*.swift" # Or latest version +github "socketio/socket.io-client-swift", "v4.0.3", :files => "SocketIOClientSwift/*.swift" # Or latest version ``` Run `seed install`. diff --git a/Socket.IO-Client-Swift.podspec b/Socket.IO-Client-Swift.podspec index 670f3da..60813b6 100644 --- a/Socket.IO-Client-Swift.podspec +++ b/Socket.IO-Client-Swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Socket.IO-Client-Swift" - s.version = "4.0.2" + s.version = "4.0.3" s.summary = "Socket.IO-client for iOS and OS X" s.description = <<-DESC Socket.IO-client for iOS and OS X. @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.author = { "Erik" => "nuclear.ace@gmail.com" } s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' - s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v4.0.2' } + s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v4.0.3' } s.source_files = "SocketIOClientSwift/**/*.swift" s.requires_arc = true # s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files diff --git a/SocketIOClientSwift/SocketEngine.swift b/SocketIOClientSwift/SocketEngine.swift index ce2d10d..8cd2980 100644 --- a/SocketIOClientSwift/SocketEngine.swift +++ b/SocketIOClientSwift/SocketEngine.swift @@ -93,6 +93,12 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate { continue } } + + if session == nil { + session = NSURLSession(configuration: .defaultSessionConfiguration(), + delegate: nil, + delegateQueue: workQueue) + } } public convenience init(client: SocketEngineClient, options: NSDictionary?) {