Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6147cda561 | ||
|
|
fcfb409282 | ||
|
|
d03d77aff8 | ||
|
|
637e0bb14c | ||
|
|
32ba61fb09 | ||
|
|
a9aa28ae77 | ||
|
|
99adb49736 | ||
|
|
21d242ba6a | ||
|
|
10d24c47ec | ||
|
|
604c30bf28 | ||
|
|
1d56759276 | ||
|
|
af77e984ab | ||
|
|
1af7bd842e | ||
|
|
7bd019fb28 | ||
|
|
cc449a49ea | ||
|
|
b65b63a9f0 | ||
|
|
87c86f8aeb | ||
|
|
c9b60445ca |
No files matched your search
+4
-8
@@ -2,12 +2,8 @@ language: objective-c
|
||||
xcode_project: Socket.IO-Client-Swift.xcodeproj # path to your xcodeproj folder
|
||||
xcode_scheme: SocketIO-iOS
|
||||
osx_image: xcode7.3
|
||||
before_install:
|
||||
- cd Socket.IO-Test-Server/
|
||||
- npm install
|
||||
- cd ..
|
||||
install: node Socket.IO-Test-Server/main.js &
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
script: xctool -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build test -parallelize
|
||||
cache:
|
||||
directories:
|
||||
- Socket.IO-Test-Server/node_modules
|
||||
@@ -88,21 +88,21 @@ Carthage
|
||||
-----------------
|
||||
Add this line to your `Cartfile`:
|
||||
```
|
||||
github "socketio/socket.io-client-swift" ~> 6.1.5 # Or latest version
|
||||
github "socketio/socket.io-client-swift" ~> 6.1.6 # Or latest version
|
||||
```
|
||||
|
||||
Run `carthage update --platform ios,macosx`.
|
||||
|
||||
CocoaPods 0.36.0 or later (iOS 8+)
|
||||
CocoaPods 1.0.0 or later
|
||||
------------------
|
||||
Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
|
||||
|
||||
```ruby
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
use_frameworks!
|
||||
|
||||
pod 'Socket.IO-Client-Swift', '~> 6.1.5' # Or latest version
|
||||
target 'YourApp' do
|
||||
pod 'Socket.IO-Client-Swift', '~> 6.1.6' # Or latest version
|
||||
end
|
||||
```
|
||||
|
||||
Install pods:
|
||||
@@ -121,7 +121,7 @@ import SocketIOClientSwift
|
||||
Objective-C:
|
||||
|
||||
```Objective-C
|
||||
#import <SocketIOClientSwift/SocketIOClientSwift-Swift.h>
|
||||
@import SocketIOClientSwift;
|
||||
```
|
||||
|
||||
CocoaSeeds
|
||||
@@ -130,7 +130,7 @@ CocoaSeeds
|
||||
Add this line to your `Seedfile`:
|
||||
|
||||
```
|
||||
github "socketio/socket.io-client-swift", "v6.1.5", :files => "Source/*.swift" # Or latest version
|
||||
github "socketio/socket.io-client-swift", "v6.1.6", :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 = "6.1.5"
|
||||
s.version = "6.1.6"
|
||||
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 => 'v6.1.5' }
|
||||
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v6.1.6' }
|
||||
s.source_files = "Source/**/*.swift"
|
||||
s.requires_arc = true
|
||||
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
|
||||
|
||||
@@ -55,7 +55,7 @@ public class SSLSecurity : NSObject {
|
||||
|
||||
var isReady = false //is the key processing done?
|
||||
var certificates: [NSData]? //the certificates
|
||||
var pubKeys: [SecKeyRef]? //the public keys
|
||||
@nonobjc var pubKeys: [SecKeyRef]? //the public keys
|
||||
var usePublicKeys = false //use public keys or certificate validation?
|
||||
|
||||
/**
|
||||
@@ -241,7 +241,7 @@ public class SSLSecurity : NSObject {
|
||||
|
||||
- returns: the public keys from the certifcate chain for the trust
|
||||
*/
|
||||
func publicKeyChainForTrust(trust: SecTrustRef) -> [SecKeyRef] {
|
||||
@nonobjc func publicKeyChainForTrust(trust: SecTrustRef) -> [SecKeyRef] {
|
||||
let policy = SecPolicyCreateBasicX509()
|
||||
let keys = (0..<SecTrustGetCertificateCount(trust)).reduce([SecKeyRef]()) { (keys: [SecKeyRef], index: Int) -> [SecKeyRef] in
|
||||
var keys = keys
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWebsocket {
|
||||
public final class SocketEngine : NSObject, NSURLSessionDelegate, SocketEnginePollable, SocketEngineWebsocket {
|
||||
public let emitQueue = dispatch_queue_create("com.socketio.engineEmitQueue", DISPATCH_QUEUE_SERIAL)
|
||||
public let handleQueue = dispatch_queue_create("com.socketio.engineHandleQueue", DISPATCH_QUEUE_SERIAL)
|
||||
public let parseQueue = dispatch_queue_create("com.socketio.engineParseQueue", DISPATCH_QUEUE_SERIAL)
|
||||
@@ -102,6 +102,10 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
||||
forceWebsockets = force
|
||||
case let .Path(path):
|
||||
socketPath = path
|
||||
|
||||
if !socketPath.hasSuffix("/") {
|
||||
socketPath += "/"
|
||||
}
|
||||
case let .VoipEnabled(enable):
|
||||
voipEnabled = enable
|
||||
case let .Secure(secure):
|
||||
@@ -117,6 +121,8 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
||||
|
||||
super.init()
|
||||
|
||||
sessionDelegate = sessionDelegate ?? self
|
||||
|
||||
(urlPolling, urlWebSocket) = createURLs()
|
||||
}
|
||||
|
||||
@@ -205,9 +211,7 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
||||
}
|
||||
}
|
||||
|
||||
dispatch_async(emitQueue) {
|
||||
self.doLongPoll(reqPolling)
|
||||
}
|
||||
doLongPoll(reqPolling)
|
||||
}
|
||||
|
||||
private func createURLs() -> (NSURL, NSURL) {
|
||||
@@ -456,7 +460,7 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
||||
invalidated = false
|
||||
session = NSURLSession(configuration: .defaultSessionConfiguration(),
|
||||
delegate: sessionDelegate,
|
||||
delegateQueue: NSOperationQueue())
|
||||
delegateQueue: NSOperationQueue.mainQueue())
|
||||
sid = ""
|
||||
waitingForPoll = false
|
||||
waitingForPost = false
|
||||
@@ -549,3 +553,11 @@ public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SocketEngine {
|
||||
public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) {
|
||||
DefaultSocketLogger.Logger.error("Engine URLSession became invalid", type: "SocketEngine")
|
||||
|
||||
didError("Engine URLSession became invalid")
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,6 @@ extension SocketEnginePollable {
|
||||
|
||||
func doRequest(req: NSURLRequest, withCallback callback: (NSData?, NSURLResponse?, NSError?) -> Void) {
|
||||
if !polling || closed || invalidated || fastUpgrade {
|
||||
DefaultSocketLogger.Logger.error("Tried to do polling request when not supposed to", type: "SocketEnginePolling")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user