Compare commits

..
3 Commits
Author SHA1 Message Date
Erik 750ba138e1 bump version 2016-02-05 14:05:50 -05:00
Erik 3e8ca90e3a don't fatalerror 2016-02-05 13:09:26 -05:00
Erik 2a25027077 change to weak self 2016-02-04 15:59:39 -05:00
4 changed files with 22 additions and 10 deletions

No files matched your search

+3 -3
View File
@@ -86,7 +86,7 @@ Carthage
-----------------
Add this line to your `Cartfile`:
```
github "socketio/socket.io-client-swift" ~> 5.3.2 # Or latest version
github "socketio/socket.io-client-swift" ~> 5.3.3 # Or latest version
```
Run `carthage update --platform ios,macosx`.
@@ -100,7 +100,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Socket.IO-Client-Swift', '~> 5.3.2' # Or latest version
pod 'Socket.IO-Client-Swift', '~> 5.3.3' # Or latest version
```
Install pods:
@@ -128,7 +128,7 @@ CocoaSeeds
Add this line to your `Seedfile`:
```
github "socketio/socket.io-client-swift", "v5.3.2", :files => "Source/*.swift" # Or latest version
github "socketio/socket.io-client-swift", "v5.3.3", :files => "Source/*.swift" # Or latest version
```
Run `seed install`.
+2 -2
View File
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Socket.IO-Client-Swift"
s.module_name = "SocketIOClientSwift"
s.version = "5.3.2"
s.version = "5.3.3"
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 => 'v5.3.2' }
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v5.3.3' }
s.source_files = "Source/**/*.swift"
s.requires_arc = true
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
+13 -2
View File
@@ -23,11 +23,22 @@ internal final class SwiftRegex: NSObject, BooleanType {
var regex: NSRegularExpression
init(target:String, pattern:String, options:NSRegularExpressionOptions?) {
self.target = target
if dispatch_semaphore_wait(lock, dispatch_time(DISPATCH_TIME_NOW, Int64(10 * NSEC_PER_MSEC))) != 0 {
fatalError("This should never happen")
do {
let regex = try NSRegularExpression(pattern: pattern, options:
NSRegularExpressionOptions.DotMatchesLineSeparators)
self.regex = regex
} catch let error as NSError {
SwiftRegex.failure("Error in pattern: \(pattern) - \(error)")
self.regex = NSRegularExpression()
}
super.init()
return
}
self.target = target
if let regex = swiftRegexCache[pattern] {
self.regex = regex
} else {
+4 -3
View File
@@ -308,13 +308,14 @@ public class WebSocket : NSObject, NSStreamDelegate {
let bytes = UnsafePointer<UInt8>(data.bytes)
var timeout = 5000000 //wait 5 seconds before giving up
writeQueue.addOperationWithBlock { [unowned self] in
writeQueue.addOperationWithBlock { [weak self] in
guard let this = self else { return }
while !outStream.hasSpaceAvailable {
usleep(100) //wait until the socket is ready
timeout -= 100
if timeout < 0 {
self.cleanupStream()
self.doDisconnect(self.errorWithDetail("write wait timed out", code: 2))
this.cleanupStream()
this.doDisconnect(this.errorWithDetail("write wait timed out", code: 2))
return
} else if outStream.streamError != nil {
return //disconnectStream will be called.