Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7c824c3c5 | ||
|
|
89ab458a5f | ||
|
|
bd7f94333d | ||
|
|
4de7a48e87 |
No files matched your search
@@ -91,7 +91,7 @@ Carthage
|
||||
-----------------
|
||||
Add this line to your `Cartfile`:
|
||||
```
|
||||
github "socketio/socket.io-client-swift" ~> 7.0.0 # Or latest version
|
||||
github "socketio/socket.io-client-swift" ~> 7.0.1 # Or latest version
|
||||
```
|
||||
|
||||
Run `carthage update --platform ios,macosx`.
|
||||
@@ -104,7 +104,7 @@ Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
|
||||
use_frameworks!
|
||||
|
||||
target 'YourApp' do
|
||||
pod 'Socket.IO-Client-Swift', '~> 7.0.0' # Or latest version
|
||||
pod 'Socket.IO-Client-Swift', '~> 7.0.1' # Or latest version
|
||||
end
|
||||
```
|
||||
|
||||
@@ -133,7 +133,7 @@ CocoaSeeds
|
||||
Add this line to your `Seedfile`:
|
||||
|
||||
```
|
||||
github "socketio/socket.io-client-swift", "v7.0.0", :files => "Source/*.swift" # Or latest version
|
||||
github "socketio/socket.io-client-swift", "v7.0.1", :files => "Source/*.swift" # Or latest version
|
||||
```
|
||||
|
||||
Run `seed install`.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Socket.IO-Client-Swift"
|
||||
s.module_name = "SocketIOClientSwift"
|
||||
s.version = "7.0.0"
|
||||
s.version = "7.0.1"
|
||||
s.summary = "Socket.IO-client for iOS and OS X"
|
||||
s.description = <<-DESC
|
||||
Socket.IO-client for iOS and OS X.
|
||||
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.osx.deployment_target = '10.10'
|
||||
s.tvos.deployment_target = '9.0'
|
||||
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v7.0.0' }
|
||||
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v7.0.1' }
|
||||
s.source_files = "Source/**/*.swift"
|
||||
s.requires_arc = true
|
||||
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
|
||||
|
||||
+31
-29
@@ -359,36 +359,38 @@ public final class SocketEngine : NSObject, NSURLSessionDelegate, SocketEnginePo
|
||||
private func handleOpen(openData: String) {
|
||||
do {
|
||||
let json = try openData.toNSDictionary()
|
||||
|
||||
if let sid = json["sid"] as? String {
|
||||
let upgradeWs: Bool
|
||||
|
||||
self.sid = sid
|
||||
connected = true
|
||||
|
||||
if let upgrades = json["upgrades"] as? [String] {
|
||||
upgradeWs = upgrades.contains("websocket")
|
||||
} 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 {
|
||||
createWebsocketAndConnect()
|
||||
}
|
||||
|
||||
sendPing()
|
||||
|
||||
if !forceWebsockets {
|
||||
doPoll()
|
||||
}
|
||||
|
||||
client?.engineDidOpen("Connect")
|
||||
guard let sid = json[sid] as? String else {
|
||||
client?.engineDidError("Open packet contained no sid")
|
||||
return
|
||||
}
|
||||
|
||||
let upgradeWs: Bool
|
||||
|
||||
self.sid = sid
|
||||
connected = true
|
||||
|
||||
if let upgrades = json["upgrades"] as? [String] {
|
||||
upgradeWs = upgrades.contains("websocket")
|
||||
} 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 {
|
||||
createWebsocketAndConnect()
|
||||
}
|
||||
|
||||
sendPing()
|
||||
|
||||
if !forceWebsockets {
|
||||
doPoll()
|
||||
}
|
||||
|
||||
client?.engineDidOpen("Connect")
|
||||
} catch {
|
||||
didError("Error parsing open packet")
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public struct SocketIOClientConfiguration : ArrayLiteralConvertible, CollectionT
|
||||
|
||||
@warn_unused_result
|
||||
public func prefixThrough(position: Index) -> SubSequence {
|
||||
return prefixThrough(position)
|
||||
return backingArray.prefixThrough(position)
|
||||
}
|
||||
|
||||
@warn_unused_result
|
||||
|
||||
@@ -32,8 +32,8 @@ extension SocketParsable {
|
||||
return nsp == self.nsp
|
||||
}
|
||||
|
||||
private func handleConnect(p: SocketPacket) {
|
||||
if p.nsp == "/" && nsp != "/" {
|
||||
private func handleConnect(packetNamespace: String) {
|
||||
if packetNamespace == "/" && nsp != "/" {
|
||||
joinNamespace(nsp)
|
||||
} else {
|
||||
didConnect()
|
||||
@@ -51,7 +51,7 @@ extension SocketParsable {
|
||||
case .BinaryAck where isCorrectNamespace(pack.nsp):
|
||||
waitingPackets.append(pack)
|
||||
case .Connect:
|
||||
handleConnect(pack)
|
||||
handleConnect(pack.nsp)
|
||||
case .Disconnect:
|
||||
didDisconnect("Got Disconnect")
|
||||
case .Error:
|
||||
|
||||
Reference in new issue
Block a user