Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bb7fdd2eb | ||
|
|
650538ad2e | ||
|
|
b1debdf912 | ||
|
|
077de02345 | ||
|
|
163a770abc | ||
|
|
fc2a8e348c | ||
|
|
56278795ea | ||
|
|
a82f27ab8c | ||
|
|
2b8476ceca | ||
|
|
5ed4723535 | ||
|
|
b6aaa42337 | ||
|
|
e723604816 | ||
|
|
51ee9654da | ||
|
|
ea3fca3767 | ||
|
|
efad448fab | ||
|
|
018c993a9d | ||
|
|
863480acf2 | ||
|
|
ff12285e94 | ||
|
|
51b95f9cee | ||
|
|
86181525df | ||
|
|
0143dc25bf |
No files matched your search
@@ -39,7 +39,7 @@ SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:url config:@{
|
||||
[socket on:@"currentAmount" callback:^(NSArray* data, SocketAckEmitter* ack) {
|
||||
double cur = [[data objectAtIndex:0] floatValue];
|
||||
|
||||
[[socket emitWithAck:@"testAckEmit" with:@[@YES]] timingOutAfter:0 callback:^(NSArray* data) {
|
||||
[[socket emitWithAck:@"canUpdate" with:@[@(cur)]] timingOutAfter:0 callback:^(NSArray* data) {
|
||||
[socket emit:@"update" withItems:@[@{@"amount": @(cur + 2.50)}]];
|
||||
}];
|
||||
|
||||
@@ -95,7 +95,7 @@ Carthage
|
||||
-----------------
|
||||
Add this line to your `Cartfile`:
|
||||
```
|
||||
github "socketio/socket.io-client-swift" ~> 8.1.0 # Or latest version
|
||||
github "socketio/socket.io-client-swift" ~> 8.2.0 # Or latest version
|
||||
```
|
||||
|
||||
Run `carthage update --platform ios,macosx`.
|
||||
@@ -108,7 +108,7 @@ Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
|
||||
use_frameworks!
|
||||
|
||||
target 'YourApp' do
|
||||
pod 'Socket.IO-Client-Swift', '~> 8.1.0' # Or latest version
|
||||
pod 'Socket.IO-Client-Swift', '~> 8.2.0' # Or latest version
|
||||
end
|
||||
```
|
||||
|
||||
@@ -137,7 +137,7 @@ CocoaSeeds
|
||||
Add this line to your `Seedfile`:
|
||||
|
||||
```
|
||||
github "socketio/socket.io-client-swift", "v8.1.0", :files => "Source/*.swift" # Or latest version
|
||||
github "socketio/socket.io-client-swift", "v8.2.0", :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 = "SocketIO"
|
||||
s.version = "8.1.0"
|
||||
s.version = "8.2.0"
|
||||
s.summary = "Socket.IO-client for iOS and OS X"
|
||||
s.description = <<-DESC
|
||||
Socket.IO-client for iOS and OS X.
|
||||
@@ -14,8 +14,9 @@ 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 => 'v8.1.0' }
|
||||
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v8.2.0' }
|
||||
s.source_files = "Source/**/*.swift"
|
||||
s.requires_arc = true
|
||||
s.pod_target_xcconfig = {'SWIFT_VERSION' => '3.0'}
|
||||
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
|
||||
end
|
||||
@@ -26,7 +26,7 @@ public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: SecTrust, domain: String?) -> Bool
|
||||
}
|
||||
|
||||
open class SSLCert {
|
||||
open class SSLCert : NSObject {
|
||||
var certData: Data?
|
||||
var key: SecKey?
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ import Foundation
|
||||
public final class SocketAckEmitter : NSObject {
|
||||
let socket: SocketIOClient
|
||||
let ackNum: Int
|
||||
|
||||
public var expected: Bool {
|
||||
return ackNum != -1
|
||||
}
|
||||
|
||||
init(socket: SocketIOClient, ackNum: Int) {
|
||||
self.socket = socket
|
||||
@@ -44,6 +48,7 @@ public final class SocketAckEmitter : NSObject {
|
||||
|
||||
socket.emitAck(ackNum, with: items)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class OnAckCallback : NSObject {
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
|
||||
var waitingPackets = [SocketPacket]()
|
||||
|
||||
public var sid: String? {
|
||||
return nsp + "#" + (engine?.sid ?? "")
|
||||
return engine?.sid
|
||||
}
|
||||
|
||||
/// Type safe way to create a new SocketIOClient. opts can be omitted
|
||||
@@ -253,7 +253,7 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
|
||||
}
|
||||
|
||||
public func engineDidClose(reason: String) {
|
||||
parseQueue.sync {
|
||||
parseQueue.async {
|
||||
self.waitingPackets.removeAll()
|
||||
}
|
||||
|
||||
|
||||
@@ -162,6 +162,11 @@ open class WebSocket : NSObject, StreamDelegate {
|
||||
public init(url: URL, protocols: [String]? = nil) {
|
||||
self.url = url
|
||||
self.origin = url.absoluteString
|
||||
if let hostUrl = URL (string: "/", relativeTo: url) {
|
||||
var origin = hostUrl.absoluteString
|
||||
origin.remove(at: origin.index(before: origin.endIndex))
|
||||
self.origin = origin
|
||||
}
|
||||
writeQueue.maxConcurrentOperationCount = 1
|
||||
optionalProtocols = protocols
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user