Merge branch 'master' into travis

* master:
  fix namespaces
  bump version
This commit is contained in:
Erik 2015-09-25 12:42:30 -04:00
commit 288c04e629
3 changed files with 10 additions and 10 deletions

View File

@ -64,7 +64,7 @@ Carthage
----------------- -----------------
Add this line to your `Cartfile`: Add this line to your `Cartfile`:
``` ```
github "socketio/socket.io-client-swift" ~> 3.1.0 # Or latest version github "socketio/socket.io-client-swift" ~> 3.1.1 # Or latest version
``` ```
Run `carthage update --platform ios,macosx`. Run `carthage update --platform ios,macosx`.
@ -83,7 +83,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0' platform :ios, '8.0'
use_frameworks! use_frameworks!
pod 'Socket.IO-Client-Swift', '~> 3.1.0' # Or latest version pod 'Socket.IO-Client-Swift', '~> 3.1.1' # Or latest version
``` ```
Install pods: Install pods:

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "Socket.IO-Client-Swift" s.name = "Socket.IO-Client-Swift"
s.version = "3.1.0" s.version = "3.1.1"
s.summary = "Socket.IO-client for iOS and OS X" s.summary = "Socket.IO-client for iOS and OS X"
s.description = <<-DESC s.description = <<-DESC
Socket.IO-client for iOS and OS X. 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.author = { "Erik" => "nuclear.ace@gmail.com" }
s.ios.deployment_target = '8.0' s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10' s.osx.deployment_target = '10.10'
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v3.1.0' } s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v3.1.1' }
s.source_files = "SocketIOClientSwift/**/*.swift" s.source_files = "SocketIOClientSwift/**/*.swift"
s.requires_arc = true s.requires_arc = true
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files # s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files

View File

@ -39,17 +39,15 @@ class SocketParser {
} }
private static func handlePacket(pack: SocketPacket, withSocket socket: SocketIOClient) { private static func handlePacket(pack: SocketPacket, withSocket socket: SocketIOClient) {
guard isCorrectNamespace(pack.nsp, socket) else { return }
switch pack.type { switch pack.type {
case .Event: case .Event where isCorrectNamespace(pack.nsp, socket):
socket.handleEvent(pack.event, data: pack.args ?? [], socket.handleEvent(pack.event, data: pack.args ?? [],
isInternalMessage: false, wantsAck: pack.id) isInternalMessage: false, wantsAck: pack.id)
case .Ack: case .Ack where isCorrectNamespace(pack.nsp, socket):
socket.handleAck(pack.id, data: pack.data) socket.handleAck(pack.id, data: pack.data)
case .BinaryEvent: case .BinaryEvent where isCorrectNamespace(pack.nsp, socket):
socket.waitingData.append(pack) socket.waitingData.append(pack)
case .BinaryAck: case .BinaryAck where isCorrectNamespace(pack.nsp, socket):
socket.waitingData.append(pack) socket.waitingData.append(pack)
case .Connect: case .Connect:
handleConnect(pack, socket: socket) handleConnect(pack, socket: socket)
@ -57,6 +55,8 @@ class SocketParser {
socket.didDisconnect("Got Disconnect") socket.didDisconnect("Got Disconnect")
case .Error: case .Error:
socket.didError("Error: \(pack.data)") socket.didError("Error: \(pack.data)")
default:
Logger.log("Got invalid packet: %@", type: "SocketParser", args: pack.description)
} }
} }