Compare commits

..
4 Commits
Author SHA1 Message Date
Erik 31a2079222 fix warning 2015-09-08 09:22:37 -04:00
Erik c9d26ebd65 bump version 2015-09-08 09:20:29 -04:00
Erik 77e1da2b51 fix socketio/socket.io-client-swift#166 2015-09-08 09:19:17 -04:00
Erik 17426c1432 fix socketio/socket.io-client-swift#152 2015-08-31 09:22:56 -04:00
4 changed files with 17 additions and 7 deletions

No files matched your search

+2 -2
View File
@@ -60,7 +60,7 @@ Carthage
-----------------
Add this line to your `Cartfile`:
```
github "socketio/socket.io-client-swift" ~> 2.4.3 # Or latest version
github "socketio/socket.io-client-swift" ~> 2.4.4 # Or latest version
```
Run `carthage update`.
@@ -79,7 +79,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Socket.IO-Client-Swift', '~> 2.4.3' # Or latest version
pod 'Socket.IO-Client-Swift', '~> 2.4.4' # Or latest version
```
Install pods:
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Socket.IO-Client-Swift"
s.version = "2.4.3"
s.version = "2.4.4"
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 => 'v2.4.3' }
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v2.4.4' }
s.source_files = "SocketIOClientSwift/**/*.swift"
s.requires_arc = true
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
+10 -2
View File
@@ -414,17 +414,25 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient {
if let json = NSJSONSerialization.JSONObjectWithData(mesData,
options: NSJSONReadingOptions.AllowFragments,
error: &err) as? NSDictionary, sid = json["sid"] as? String {
let upgradeWs: Bool
self.sid = sid
_connected = true
if !forcePolling && !forceWebsockets {
createWebsocket(andConnect: true)
if let upgrades = json["upgrades"] as? [String] {
upgradeWs = upgrades.filter {$0 == "websocket"}.count != 0
} else {
upgradeWs = false
}
if let pingInterval = json["pingInterval"] as? Double, pingTimeout = json["pingTimeout"] as? Double {
self.pingInterval = pingInterval / 1000.0
self.pingTimeout = pingTimeout / 1000.0
}
if !forcePolling && !forceWebsockets && upgradeWs {
createWebsocket(andConnect: true)
}
} else {
client?.didError("Engine failed to handshake")
return
+3 -1
View File
@@ -73,7 +73,9 @@ final class SocketPacket: Printable {
}
func getEvent() -> String {
return data?.removeAtIndex(0) as! String
let event: AnyObject? = data?.removeAtIndex(0)
return event as? String ?? String(stringInterpolationSegment: event!)
}
func addData(data:NSData) -> Bool {