Compare commits

...
98 Commits
Author SHA1 Message Date
Erik ea0fc9933e bump version 2015-07-12 16:26:02 -04:00
Erik Little 43827914b7 Merge pull request #117 from NachoSoto/master
Added project with iOS and Mac targets => Carthage support
2015-07-12 09:49:40 -04:00
NachoSoto 22b9a1e2f2 Added Carthage instructions to README 2015-07-12 01:06:26 +00:00
NachoSoto fd66a9fa62 Created project with iOS and Mac targets 2015-07-12 00:58:09 +00:00
Erik 998089df91 Invalidate timer on reconnect failure 2015-07-03 13:58:06 -04:00
Erik 283644b75c fix socketio/socket.io-client-swift#110 calling close while trying to reconnect 2015-07-03 13:53:40 -04:00
Erik 846897157c bump version 2015-07-01 07:07:32 -04:00
Erik a49f8f19cf add extraHeaders option fixes. nuclearace/Socket.IO-Client-Swift#64 2015-07-01 07:05:06 -04:00
Erik 531a9784da make it clear as to what language 2015-06-29 18:13:45 -04:00
Erik c34a660cae update readme 2015-06-29 18:12:46 -04:00
Erik 9484bc9614 update readme 2015-06-29 18:11:33 -04:00
Erik d8f65c2804 bump version 2015-06-24 06:52:24 -04:00
Erik ca3f3e810d fix socketio/socket.io-client-swift#97 2015-06-24 06:51:47 -04:00
Erik 63021eb995 bump version 2015-06-23 21:52:05 -04:00
Erik d8e3408565 set connecting 2015-06-23 18:57:37 -04:00
Erik f17575b35c use computed variable for sid 2015-06-16 05:14:32 -04:00
Erik 58571e5387 bump version 2015-06-07 13:15:03 -04:00
Erik 1a54decd51 fix socketio/socket.io-client-swift#93 2015-06-06 22:30:56 -04:00
Erik d982cdc1b2 only do interpolation when logging 2015-06-06 13:15:22 -04:00
Erik 079063e396 bump version 2015-06-05 06:59:20 -04:00
Erik 33d5fd3f10 fix base64 data 2015-06-05 06:57:59 -04:00
Erik 3be5621263 remove comment 2015-05-31 11:09:25 -04:00
Erik 81ab71f519 extract methods 2015-05-31 11:07:48 -04:00
Erik bfeec57c04 don't need type 2015-05-29 10:30:59 -04:00
Erik 0b09a1357c use didset instead of computed variable 2015-05-29 10:29:26 -04:00
Erik e8dfe589ac redo pingtimeouts 2015-05-29 10:10:24 -04:00
Erik fcebc870c3 fix socket.io/socket.io-client-swift#87 2015-05-27 07:28:06 -04:00
Erik eeadccec94 bump version 2015-05-24 08:11:30 -04:00
Erik fa0d5022cf fix socketio/socket.io-client-swift#85 2015-05-24 08:10:43 -04:00
Erik 2fdd1313a8 move open logic to method 2015-05-22 07:26:52 -04:00
Erik 61b4628d3e only use self when needed 2015-05-19 22:13:08 -04:00
Erik 77ed87d0d4 remove dumb comment 2015-05-18 18:43:26 -04:00
Erik a6f68e7b70 tweaks 2015-05-17 08:28:10 -04:00
Erik 2453f33191 bump version 2015-05-14 13:22:54 -04:00
Erik bb3d7fbded add leavenamepsace method, expose joinNamespace 2015-05-14 13:22:25 -04:00
Erik f54153f3d4 fix objc example 2015-05-13 13:40:33 -04:00
Erik 709ecc30b3 tweak ack message 2015-05-13 08:36:08 -04:00
Erik 72dd2ef364 use same example for objc 2015-05-13 08:35:19 -04:00
Erik 9ec521a6de bump version. Changes to connect 2015-05-11 12:40:05 -04:00
Erik 69c67a2b81 Merge branch 'master' into redoconnects 2015-05-11 09:21:03 -04:00
Erik dd068cb480 clarify what nsp does 2015-05-11 09:20:47 -04:00
Erik 3abb26565b tweak closing engine 2015-05-11 09:19:46 -04:00
Erik d7d1da704f document connect method 2015-05-09 15:30:39 -04:00
Erik 5a5dc70203 fix nuclearace/Socket.IO-Client-Swift#46 2015-05-09 15:20:03 -04:00
Erik c049f62028 bump version 2015-05-07 10:34:29 -04:00
Erik 88c139ed0c clean up 2015-05-07 10:32:30 -04:00
Erik fdfd4dbc4d newlines 2015-05-01 11:37:59 -04:00
Erik 9e0726d61f fix socketio/socket.io-client-swift#72 2015-04-29 23:34:49 -04:00
Erik 2ee104bb5e bump version 2015-04-29 10:07:51 -04:00
Erik 90bbc9521f work on socketio/socket.io-client-swift#70 2015-04-29 00:39:53 -04:00
Erik 7a1a0d91f9 work on socketio/socket.io-client-swift#70 2015-04-29 00:29:36 -04:00
Erik 6cb372e3b9 bump version 2015-04-28 09:53:34 -04:00
Erik 10ffe54b08 fix socketio/socket.io-client-swift#69 2015-04-28 09:50:12 -04:00
Erik 08d100b9ca fix socketio/socket.io-client-swift#65 2015-04-28 09:45:44 -04:00
Erik 1b05418674 clarify events 2015-04-27 17:22:17 -04:00
Erik 75a4adfbbd document reconnect 2015-04-27 12:59:34 -04:00
Erik 9bc40fcae1 bump version 2015-04-27 12:32:43 -04:00
Erik 1aa1a83cea Fix memory leak. Add reconnect method 2015-04-27 12:22:59 -04:00
Erik 8a23960e20 let the engine get the opts it needs 2015-04-27 10:34:23 -04:00
Erik a5b8202e45 fix socketio/socket.io-client-swift#66 2015-04-27 09:48:49 -04:00
Erik 918f176c56 fix socketio/socket.io-client-swift#65 2015-04-27 09:00:57 -04:00
Erik Little ef39651bfa Merge pull request #63 from socketio/engineclientcleanup
clean up engineclient
2015-04-25 11:16:13 -04:00
Erik e7f8f9db1a newline 2015-04-25 11:15:42 -04:00
Erik 0ccedfd0bf only emit error when there's actually an error 2015-04-25 10:48:23 -04:00
Erik 0416ecbaac clean up engineclient 2015-04-24 11:54:50 -04:00
Erik 21b295f8fa bump version 2015-04-23 14:30:40 -04:00
Erik a7fb0f847a Use the same name for objc/swift methods 2015-04-23 14:29:54 -04:00
Erik 27a767746b use new if let 2015-04-23 09:09:20 -04:00
Erik 59e068c853 tweaks 2015-04-23 07:11:22 -04:00
Erik 922ed4b575 fix socketio/socket.io-client-swift#61 2015-04-22 15:26:34 -04:00
Erik eab7311037 create write method that can be used from objc 2015-04-22 12:55:23 -04:00
Erik 7c0c12ba0c Merge branch 'yannickl-master' 2015-04-21 13:10:23 -04:00
Erik 306fc12cc5 Merge branch 'master' of https://github.com/yannickl/socket.io-client-swift into yannickl-master 2015-04-21 13:08:36 -04:00
Yannick Loriot 7f35e3e1e4 [FIX] memory leak with the takeUnretainedValue() 2015-04-21 18:57:36 +02:00
Erik cd48abe4cd bump version 2015-04-21 12:06:45 -04:00
Erik acfbcb6fe1 Merge branch 'master' of https://github.com/socketio/socket.io-client-swift 2015-04-21 12:03:52 -04:00
Erik 47f5dcbbcd style 2015-04-21 12:03:48 -04:00
Erik Little a161ed1756 Merge pull request #58 from yannickl/master
[FIX] Plus signs (+) is not URL encoded #57
2015-04-21 12:02:41 -04:00
Yannick Loriot 3fda340ad1 [FIX] Plus signs (+) is not URL encoded #57 2015-04-21 17:30:19 +02:00
Erik e33309827f actually use capture list 2015-04-20 15:18:08 -04:00
Erik 1753707bf8 don't use implicitly unwrapped engine 2015-04-20 13:54:16 -04:00
Erik cc99eae737 Add messages for socket/engine deinit 2015-04-20 12:42:35 -04:00
Erik 446cf57978 remove newline 2015-04-17 17:26:50 -04:00
Erik 80cee820a4 tweaks 2015-04-17 10:52:55 -04:00
Erik e4c2da515b clarify non-cocoapods installing 2015-04-17 10:19:22 -04:00
Erik bb4d285928 make note about required xcode version 2015-04-17 10:01:11 -04:00
Erik 5e5ec2f6b6 bump version 2015-04-17 07:57:34 -04:00
Erik 54aac236b8 update readme 2015-04-17 07:56:59 -04:00
Erik 8b05f922a6 rename socketackmap, code style changes for #55 2015-04-17 07:49:48 -04:00
Erik Little f38cf9ed3a Merge pull request #55 from ramki982/master
Adding support for self signed certificates by passing in a NSURLSessionDelegate optional
2015-04-17 07:44:23 -04:00
ramki982 057be73990 Uncommenting the string extension 2015-04-17 16:44:56 +05:30
ram ea3bd02f6a Adding a NSURLSessionDelegate to socket client options and in turn to socket engine to allow support for cases like self-signed certificates 2015-04-17 16:39:21 +05:30
Erik Little 06f04a046d Merge pull request #37 from redgreenapp/master
set cookie headers in doPoll and flushWaitingForPost
2015-04-16 16:59:02 -04:00
Matt Renaud ae27d93464 set cookie headers in doPoll and flushWaitingForPost 2015-04-16 16:48:06 -04:00
Erik 406504b09d tweaks 2015-04-16 14:27:19 -04:00
Erik 269bb5a943 tweaks 2015-04-15 09:48:03 -04:00
Erik 4be6b58150 async logging, simplify acks 2015-04-14 17:13:39 -04:00
Erik acefc89b0d tweaks 2015-04-14 16:25:08 -04:00
28 changed files with 2245 additions and 700 deletions

No files matched your search

+18
View File
@@ -23,3 +23,21 @@ Icon
Network Trash Folder
Temporary Items
.apdisk
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
+46 -14
View File
@@ -19,7 +19,6 @@ socket.on("currentAmount") {data, ack in
}
}
// Connect
socket.connect()
```
@@ -27,12 +26,18 @@ socket.connect()
```objective-c
SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:@"localhost:8080" options:nil];
[socket on: @"connect" callback: ^(NSArray* data, void (^ack)(NSArray*)) {
NSLog(@"connected");
[socket emitObjc:@"echo" withItems:@[@"echo test"]];
[socket emitWithAckObjc:@"ackack" withItems:@[@1]](10, ^(NSArray* data) {
NSLog(@"Got ack");
[socket on:@"connect" callback:^(NSArray* data, void (^ack)(NSArray*)) {
NSLog(@"socket connected");
}];
[socket on:@"currentAmount" callback:^(NSArray* data, void (^ack)(NSArray*)) {
double cur = [[data objectAtIndex:0] floatValue];
[socket emitWithAck:@"canUpdate" withItems:@[@(cur)]](0, ^(NSArray* data) {
[socket emit:@"update" withItems:@[@{@"amount": @(cur + 2.50)}]];
});
ack(@[@"Got your currentAmount, ", @"dude"]);
}];
[socket connect];
@@ -47,9 +52,23 @@ SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:@"localhost:8
- Can be used from Objective-C
##Installation
Requires Swift 1.2/Xcode 6.3
If you need Swift 1.1/Xcode 6.2 use v1.5.2. (Pre-Swift 1.2 support is no longer maintained)
Carthage
-----------------
Add this line to your `Cartfile`:
```
github "socketio/socket.io-client-swift" ~> 2.3.8 # Or latest version
```
Run `carthage update`.
Manually (iOS 7+)
-----------------
1. Copy the SocketIOClientSwift folder into your Xcode project
1. Copy the SocketIOClientSwift folder into your Xcode project. (Make sure you add the files to your target(s))
2. If you plan on using this from Objective-C, read [this](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html) on exposing Swift code to Objective-C.
CocoaPods 0.36.0 or later (iOS 8+)
------------------
@@ -60,7 +79,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Socket.IO-Client-Swift', '~> 1.3.2' # Or latest version
pod 'Socket.IO-Client-Swift', '~> 2.3.8' # Or latest version
```
Install pods:
@@ -69,12 +88,18 @@ Install pods:
$ pod install
```
Import in your swift file:
Import the module:
Swift:
```swift
import Socket_IO_Client_Swift
```
Objective-C:
```Objective-C
#import <Socket_IO_Client_Swift/Socket_IO_Client_Swift-Swift.h>
```
##API
Constructors
-----------
@@ -84,28 +109,35 @@ Constructors
Options
-------
- `connectParams: [String: AnyObject]?` - Dictionary whose contents will be passed with the connection.
- `reconnects: Bool` Default is `true`
- `reconnectAttempts: Int` Default is `-1` (infinite tries)
- `reconnectWait: Int` Default is `10`
- `forcePolling: Bool` Default is `false`. `true` forces the client to use xhr-polling.
- `forceWebsockets: Bool` Default is `false`. `true` forces the client to use WebSockets.
- `nsp: String` Default is `"/"`
- `nsp: String` Default is `"/"`. Connects to a namespace.
- `cookies: [NSHTTPCookie]?` An array of NSHTTPCookies. Passed during the handshake. Default is nil.
- `log: Bool` If `true` socket will log debug messages. Default is false.
- `sessionDelegate: NSURLSessionDelegate` Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs. Default is nil.
- `path: String` - If the server uses a custom path. ex: `"/swift"`. Default is `""`
- `extraHeaders: [String: String]?` - Adds custom headers to the initial request. Default is nil.
Methods
-------
1. `on(name:String, callback:((data:NSArray?, ack:AckEmitter?) -> Void))` - Adds a handler for an event. Items are passed by an array. `ack` can be used to send an ack when one is requested. See example.
2. `onAny(callback:((event:String, items:AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
3. `emit(event:String, _ items:AnyObject...)` - Sends a message. Can send multiple items.
4. `emitObjc(event:String, withItems items:[AnyObject])` - `emit` for Objective-C
4. `emit(event:String, withItems items:[AnyObject])` - `emit` for Objective-C
5. `emitWithAck(event:String, _ items:AnyObject...) -> (timeout:UInt64, callback:(NSArray?) -> Void) -> Void` - Sends a message that requests an acknowledgement from the server. Returns a function which you can use to add a handler. See example. Note: The message is not sent until you call the returned function.
6. `emitWithAckObjc(event:String, withItems items:[AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. Note: The message is not sent until you call the returned function.
6. `emitWithAck(event:String, withItems items:[AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. Note: The message is not sent until you call the returned function.
7. `connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
8. `connectWithParams(params:[String: AnyObject])` - Establishes a connection to the server passing the specified params. A "connect" event is fired upon successful connection.
8. `connect(#timeoutAfter:Int, withTimeoutHandler handler:(() -> Void)?)` - Connect to the server. If it isn't connected after timeoutAfter seconds, the handler is called.
9. `close(#fast:Bool)` - Closes the socket. Once a socket is closed it should not be reopened. Pass true to fast if you're closing from a background task.
10. `reconnect()` - Causes the client to reconnect to the server.
11. `joinNamespace()` - Causes the client to join nsp. Shouldn't need to be called unless you change nsp manually.
12. `leaveNamespace()` - Causes the client to leave the nsp and go back to /
Events
Client Events
------
1. `connect` - Emitted when on a successful connection.
2. `disconnect` - Emitted when the connection is closed.
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Socket.IO-Client-Swift"
s.version = "2.0.4"
s.version = "2.3.8"
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.0.4' }
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v2.3.8' }
s.source_files = "SocketIOClientSwift/**/*.swift"
s.requires_arc = true
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
@@ -0,0 +1,935 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
572EF21F1B51F16C00EEBB58 /* SocketIO-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 572EF21E1B51F16C00EEBB58 /* SocketIO-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
572EF2251B51F16C00EEBB58 /* SocketIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 572EF2191B51F16C00EEBB58 /* SocketIO.framework */; };
572EF22C1B51F16C00EEBB58 /* SocketIO_iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 572EF22B1B51F16C00EEBB58 /* SocketIO_iOSTests.swift */; };
572EF23D1B51F18A00EEBB58 /* SocketIO-Mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 572EF23C1B51F18A00EEBB58 /* SocketIO-Mac.h */; settings = {ATTRIBUTES = (Public, ); }; };
572EF2431B51F18A00EEBB58 /* SocketIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 572EF2381B51F18A00EEBB58 /* SocketIO.framework */; };
572EF24A1B51F18A00EEBB58 /* SocketIO_MacTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 572EF2491B51F18A00EEBB58 /* SocketIO_MacTests.swift */; };
5764DF891B51F254004FF46E /* SocketAckManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7C1B51F254004FF46E /* SocketAckManager.swift */; };
5764DF8A1B51F254004FF46E /* SocketAckManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7C1B51F254004FF46E /* SocketAckManager.swift */; };
5764DF8B1B51F254004FF46E /* SocketAnyEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7D1B51F254004FF46E /* SocketAnyEvent.swift */; };
5764DF8C1B51F254004FF46E /* SocketAnyEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7D1B51F254004FF46E /* SocketAnyEvent.swift */; };
5764DF8D1B51F254004FF46E /* SocketEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7E1B51F254004FF46E /* SocketEngine.swift */; };
5764DF8E1B51F254004FF46E /* SocketEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7E1B51F254004FF46E /* SocketEngine.swift */; };
5764DF8F1B51F254004FF46E /* SocketEngineClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7F1B51F254004FF46E /* SocketEngineClient.swift */; };
5764DF901B51F254004FF46E /* SocketEngineClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7F1B51F254004FF46E /* SocketEngineClient.swift */; };
5764DF911B51F254004FF46E /* SocketEventHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF801B51F254004FF46E /* SocketEventHandler.swift */; };
5764DF921B51F254004FF46E /* SocketEventHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF801B51F254004FF46E /* SocketEventHandler.swift */; };
5764DF931B51F254004FF46E /* SocketFixUTF8.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF811B51F254004FF46E /* SocketFixUTF8.swift */; };
5764DF941B51F254004FF46E /* SocketFixUTF8.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF811B51F254004FF46E /* SocketFixUTF8.swift */; };
5764DF951B51F254004FF46E /* SocketIOClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF821B51F254004FF46E /* SocketIOClient.swift */; };
5764DF961B51F254004FF46E /* SocketIOClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF821B51F254004FF46E /* SocketIOClient.swift */; };
5764DF971B51F254004FF46E /* SocketLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF831B51F254004FF46E /* SocketLogger.swift */; };
5764DF981B51F254004FF46E /* SocketLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF831B51F254004FF46E /* SocketLogger.swift */; };
5764DF991B51F254004FF46E /* SocketPacket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF841B51F254004FF46E /* SocketPacket.swift */; };
5764DF9A1B51F254004FF46E /* SocketPacket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF841B51F254004FF46E /* SocketPacket.swift */; };
5764DF9B1B51F254004FF46E /* SocketParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF851B51F254004FF46E /* SocketParser.swift */; };
5764DF9C1B51F254004FF46E /* SocketParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF851B51F254004FF46E /* SocketParser.swift */; };
5764DF9D1B51F254004FF46E /* SocketTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF861B51F254004FF46E /* SocketTypes.swift */; };
5764DF9E1B51F254004FF46E /* SocketTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF861B51F254004FF46E /* SocketTypes.swift */; };
5764DF9F1B51F254004FF46E /* SwiftRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF871B51F254004FF46E /* SwiftRegex.swift */; };
5764DFA01B51F254004FF46E /* SwiftRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF871B51F254004FF46E /* SwiftRegex.swift */; };
5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF881B51F254004FF46E /* WebSocket.swift */; };
5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF881B51F254004FF46E /* WebSocket.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
572EF2261B51F16C00EEBB58 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 572EF20E1B51F12F00EEBB58 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 572EF2181B51F16C00EEBB58;
remoteInfo = "SocketIO-iOS";
};
572EF2441B51F18A00EEBB58 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 572EF20E1B51F12F00EEBB58 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 572EF2371B51F18A00EEBB58;
remoteInfo = "SocketIO-Mac";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
572EF2191B51F16C00EEBB58 /* SocketIO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SocketIO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
572EF21D1B51F16C00EEBB58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
572EF21E1B51F16C00EEBB58 /* SocketIO-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SocketIO-iOS.h"; sourceTree = "<group>"; };
572EF2241B51F16C00EEBB58 /* SocketIO-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SocketIO-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
572EF22A1B51F16C00EEBB58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
572EF22B1B51F16C00EEBB58 /* SocketIO_iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketIO_iOSTests.swift; sourceTree = "<group>"; };
572EF2381B51F18A00EEBB58 /* SocketIO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SocketIO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
572EF23B1B51F18A00EEBB58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
572EF23C1B51F18A00EEBB58 /* SocketIO-Mac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SocketIO-Mac.h"; sourceTree = "<group>"; };
572EF2421B51F18A00EEBB58 /* SocketIO-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SocketIO-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
572EF2481B51F18A00EEBB58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
572EF2491B51F18A00EEBB58 /* SocketIO_MacTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketIO_MacTests.swift; sourceTree = "<group>"; };
5764DF7C1B51F254004FF46E /* SocketAckManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketAckManager.swift; path = SocketIOClientSwift/SocketAckManager.swift; sourceTree = "<group>"; };
5764DF7D1B51F254004FF46E /* SocketAnyEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketAnyEvent.swift; path = SocketIOClientSwift/SocketAnyEvent.swift; sourceTree = "<group>"; };
5764DF7E1B51F254004FF46E /* SocketEngine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketEngine.swift; path = SocketIOClientSwift/SocketEngine.swift; sourceTree = "<group>"; };
5764DF7F1B51F254004FF46E /* SocketEngineClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketEngineClient.swift; path = SocketIOClientSwift/SocketEngineClient.swift; sourceTree = "<group>"; };
5764DF801B51F254004FF46E /* SocketEventHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketEventHandler.swift; path = SocketIOClientSwift/SocketEventHandler.swift; sourceTree = "<group>"; };
5764DF811B51F254004FF46E /* SocketFixUTF8.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketFixUTF8.swift; path = SocketIOClientSwift/SocketFixUTF8.swift; sourceTree = "<group>"; };
5764DF821B51F254004FF46E /* SocketIOClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketIOClient.swift; path = SocketIOClientSwift/SocketIOClient.swift; sourceTree = "<group>"; };
5764DF831B51F254004FF46E /* SocketLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketLogger.swift; path = SocketIOClientSwift/SocketLogger.swift; sourceTree = "<group>"; };
5764DF841B51F254004FF46E /* SocketPacket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketPacket.swift; path = SocketIOClientSwift/SocketPacket.swift; sourceTree = "<group>"; };
5764DF851B51F254004FF46E /* SocketParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketParser.swift; path = SocketIOClientSwift/SocketParser.swift; sourceTree = "<group>"; };
5764DF861B51F254004FF46E /* SocketTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketTypes.swift; path = SocketIOClientSwift/SocketTypes.swift; sourceTree = "<group>"; };
5764DF871B51F254004FF46E /* SwiftRegex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftRegex.swift; path = SocketIOClientSwift/SwiftRegex.swift; sourceTree = "<group>"; };
5764DF881B51F254004FF46E /* WebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebSocket.swift; path = SocketIOClientSwift/WebSocket.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
572EF2151B51F16C00EEBB58 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2211B51F16C00EEBB58 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
572EF2251B51F16C00EEBB58 /* SocketIO.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2341B51F18A00EEBB58 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF23F1B51F18A00EEBB58 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
572EF2431B51F18A00EEBB58 /* SocketIO.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
572EF20D1B51F12F00EEBB58 = {
isa = PBXGroup;
children = (
5764DF7B1B51F24A004FF46E /* Source */,
572EF21B1B51F16C00EEBB58 /* SocketIO-iOS */,
572EF2281B51F16C00EEBB58 /* SocketIO-iOSTests */,
572EF2391B51F18A00EEBB58 /* SocketIO-Mac */,
572EF2461B51F18A00EEBB58 /* SocketIO-MacTests */,
572EF21A1B51F16C00EEBB58 /* Products */,
);
sourceTree = "<group>";
};
572EF21A1B51F16C00EEBB58 /* Products */ = {
isa = PBXGroup;
children = (
572EF2191B51F16C00EEBB58 /* SocketIO.framework */,
572EF2241B51F16C00EEBB58 /* SocketIO-iOSTests.xctest */,
572EF2381B51F18A00EEBB58 /* SocketIO.framework */,
572EF2421B51F18A00EEBB58 /* SocketIO-MacTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
572EF21B1B51F16C00EEBB58 /* SocketIO-iOS */ = {
isa = PBXGroup;
children = (
572EF21E1B51F16C00EEBB58 /* SocketIO-iOS.h */,
572EF21C1B51F16C00EEBB58 /* Supporting Files */,
);
path = "SocketIO-iOS";
sourceTree = "<group>";
};
572EF21C1B51F16C00EEBB58 /* Supporting Files */ = {
isa = PBXGroup;
children = (
572EF21D1B51F16C00EEBB58 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
572EF2281B51F16C00EEBB58 /* SocketIO-iOSTests */ = {
isa = PBXGroup;
children = (
572EF22B1B51F16C00EEBB58 /* SocketIO_iOSTests.swift */,
572EF2291B51F16C00EEBB58 /* Supporting Files */,
);
path = "SocketIO-iOSTests";
sourceTree = "<group>";
};
572EF2291B51F16C00EEBB58 /* Supporting Files */ = {
isa = PBXGroup;
children = (
572EF22A1B51F16C00EEBB58 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
572EF2391B51F18A00EEBB58 /* SocketIO-Mac */ = {
isa = PBXGroup;
children = (
572EF23C1B51F18A00EEBB58 /* SocketIO-Mac.h */,
572EF23A1B51F18A00EEBB58 /* Supporting Files */,
);
path = "SocketIO-Mac";
sourceTree = "<group>";
};
572EF23A1B51F18A00EEBB58 /* Supporting Files */ = {
isa = PBXGroup;
children = (
572EF23B1B51F18A00EEBB58 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
572EF2461B51F18A00EEBB58 /* SocketIO-MacTests */ = {
isa = PBXGroup;
children = (
572EF2491B51F18A00EEBB58 /* SocketIO_MacTests.swift */,
572EF2471B51F18A00EEBB58 /* Supporting Files */,
);
path = "SocketIO-MacTests";
sourceTree = "<group>";
};
572EF2471B51F18A00EEBB58 /* Supporting Files */ = {
isa = PBXGroup;
children = (
572EF2481B51F18A00EEBB58 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
5764DF7B1B51F24A004FF46E /* Source */ = {
isa = PBXGroup;
children = (
5764DF7C1B51F254004FF46E /* SocketAckManager.swift */,
5764DF7D1B51F254004FF46E /* SocketAnyEvent.swift */,
5764DF7E1B51F254004FF46E /* SocketEngine.swift */,
5764DF7F1B51F254004FF46E /* SocketEngineClient.swift */,
5764DF801B51F254004FF46E /* SocketEventHandler.swift */,
5764DF811B51F254004FF46E /* SocketFixUTF8.swift */,
5764DF821B51F254004FF46E /* SocketIOClient.swift */,
5764DF831B51F254004FF46E /* SocketLogger.swift */,
5764DF841B51F254004FF46E /* SocketPacket.swift */,
5764DF851B51F254004FF46E /* SocketParser.swift */,
5764DF861B51F254004FF46E /* SocketTypes.swift */,
5764DF871B51F254004FF46E /* SwiftRegex.swift */,
5764DF881B51F254004FF46E /* WebSocket.swift */,
);
name = Source;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
572EF2161B51F16C00EEBB58 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
572EF21F1B51F16C00EEBB58 /* SocketIO-iOS.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2351B51F18A00EEBB58 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
572EF23D1B51F18A00EEBB58 /* SocketIO-Mac.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
572EF2181B51F16C00EEBB58 /* SocketIO-iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 572EF22D1B51F16C00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-iOS" */;
buildPhases = (
572EF2141B51F16C00EEBB58 /* Sources */,
572EF2151B51F16C00EEBB58 /* Frameworks */,
572EF2161B51F16C00EEBB58 /* Headers */,
572EF2171B51F16C00EEBB58 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "SocketIO-iOS";
productName = "SocketIO-iOS";
productReference = 572EF2191B51F16C00EEBB58 /* SocketIO.framework */;
productType = "com.apple.product-type.framework";
};
572EF2231B51F16C00EEBB58 /* SocketIO-iOSTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 572EF2301B51F16C00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-iOSTests" */;
buildPhases = (
572EF2201B51F16C00EEBB58 /* Sources */,
572EF2211B51F16C00EEBB58 /* Frameworks */,
572EF2221B51F16C00EEBB58 /* Resources */,
);
buildRules = (
);
dependencies = (
572EF2271B51F16C00EEBB58 /* PBXTargetDependency */,
);
name = "SocketIO-iOSTests";
productName = "SocketIO-iOSTests";
productReference = 572EF2241B51F16C00EEBB58 /* SocketIO-iOSTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
572EF2371B51F18A00EEBB58 /* SocketIO-Mac */ = {
isa = PBXNativeTarget;
buildConfigurationList = 572EF24B1B51F18A00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-Mac" */;
buildPhases = (
572EF2331B51F18A00EEBB58 /* Sources */,
572EF2341B51F18A00EEBB58 /* Frameworks */,
572EF2351B51F18A00EEBB58 /* Headers */,
572EF2361B51F18A00EEBB58 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "SocketIO-Mac";
productName = "SocketIO-Mac";
productReference = 572EF2381B51F18A00EEBB58 /* SocketIO.framework */;
productType = "com.apple.product-type.framework";
};
572EF2411B51F18A00EEBB58 /* SocketIO-MacTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 572EF24E1B51F18A00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-MacTests" */;
buildPhases = (
572EF23E1B51F18A00EEBB58 /* Sources */,
572EF23F1B51F18A00EEBB58 /* Frameworks */,
572EF2401B51F18A00EEBB58 /* Resources */,
);
buildRules = (
);
dependencies = (
572EF2451B51F18A00EEBB58 /* PBXTargetDependency */,
);
name = "SocketIO-MacTests";
productName = "SocketIO-MacTests";
productReference = 572EF2421B51F18A00EEBB58 /* SocketIO-MacTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
572EF20E1B51F12F00EEBB58 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0640;
TargetAttributes = {
572EF2181B51F16C00EEBB58 = {
CreatedOnToolsVersion = 6.4;
};
572EF2231B51F16C00EEBB58 = {
CreatedOnToolsVersion = 6.4;
};
572EF2371B51F18A00EEBB58 = {
CreatedOnToolsVersion = 6.4;
};
572EF2411B51F18A00EEBB58 = {
CreatedOnToolsVersion = 6.4;
};
};
};
buildConfigurationList = 572EF2111B51F12F00EEBB58 /* Build configuration list for PBXProject "Socket.IO-Client-Swift" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 572EF20D1B51F12F00EEBB58;
productRefGroup = 572EF21A1B51F16C00EEBB58 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
572EF2181B51F16C00EEBB58 /* SocketIO-iOS */,
572EF2231B51F16C00EEBB58 /* SocketIO-iOSTests */,
572EF2371B51F18A00EEBB58 /* SocketIO-Mac */,
572EF2411B51F18A00EEBB58 /* SocketIO-MacTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
572EF2171B51F16C00EEBB58 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2221B51F16C00EEBB58 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2361B51F18A00EEBB58 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2401B51F18A00EEBB58 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
572EF2141B51F16C00EEBB58 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5764DF8D1B51F254004FF46E /* SocketEngine.swift in Sources */,
5764DF9B1B51F254004FF46E /* SocketParser.swift in Sources */,
5764DF9D1B51F254004FF46E /* SocketTypes.swift in Sources */,
5764DF8F1B51F254004FF46E /* SocketEngineClient.swift in Sources */,
5764DF911B51F254004FF46E /* SocketEventHandler.swift in Sources */,
5764DF931B51F254004FF46E /* SocketFixUTF8.swift in Sources */,
5764DF951B51F254004FF46E /* SocketIOClient.swift in Sources */,
5764DF8B1B51F254004FF46E /* SocketAnyEvent.swift in Sources */,
5764DF971B51F254004FF46E /* SocketLogger.swift in Sources */,
5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */,
5764DF991B51F254004FF46E /* SocketPacket.swift in Sources */,
5764DF891B51F254004FF46E /* SocketAckManager.swift in Sources */,
5764DF9F1B51F254004FF46E /* SwiftRegex.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2201B51F16C00EEBB58 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
572EF22C1B51F16C00EEBB58 /* SocketIO_iOSTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF2331B51F18A00EEBB58 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5764DF8E1B51F254004FF46E /* SocketEngine.swift in Sources */,
5764DF9C1B51F254004FF46E /* SocketParser.swift in Sources */,
5764DF9E1B51F254004FF46E /* SocketTypes.swift in Sources */,
5764DF901B51F254004FF46E /* SocketEngineClient.swift in Sources */,
5764DF921B51F254004FF46E /* SocketEventHandler.swift in Sources */,
5764DF941B51F254004FF46E /* SocketFixUTF8.swift in Sources */,
5764DF961B51F254004FF46E /* SocketIOClient.swift in Sources */,
5764DF8C1B51F254004FF46E /* SocketAnyEvent.swift in Sources */,
5764DF981B51F254004FF46E /* SocketLogger.swift in Sources */,
5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */,
5764DF9A1B51F254004FF46E /* SocketPacket.swift in Sources */,
5764DF8A1B51F254004FF46E /* SocketAckManager.swift in Sources */,
5764DFA01B51F254004FF46E /* SwiftRegex.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
572EF23E1B51F18A00EEBB58 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
572EF24A1B51F18A00EEBB58 /* SocketIO_MacTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
572EF2271B51F16C00EEBB58 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 572EF2181B51F16C00EEBB58 /* SocketIO-iOS */;
targetProxy = 572EF2261B51F16C00EEBB58 /* PBXContainerItemProxy */;
};
572EF2451B51F18A00EEBB58 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 572EF2371B51F18A00EEBB58 /* SocketIO-Mac */;
targetProxy = 572EF2441B51F18A00EEBB58 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
572EF2121B51F12F00EEBB58 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = SocketIO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
572EF2131B51F12F00EEBB58 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = SocketIO;
SWIFT_WHOLE_MODULE_OPTIMIZATION = YES;
};
name = Release;
};
572EF22E1B51F16C00EEBB58 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-iOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
572EF22F1B51F16C00EEBB58 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-iOS/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
572EF2311B51F16C00EEBB58 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-iOSTests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
};
name = Debug;
};
572EF2321B51F16C00EEBB58 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-iOSTests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
572EF24C1B51F18A00EEBB58 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_VERSION = A;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-Mac/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
572EF24D1B51F18A00EEBB58 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_VERSION = A;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-Mac/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
572EF24F1B51F18A00EEBB58 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(DEVELOPER_FRAMEWORKS_DIR)",
"$(inherited)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-MacTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Debug;
};
572EF2501B51F18A00EEBB58 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(DEVELOPER_FRAMEWORKS_DIR)",
"$(inherited)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "SocketIO-MacTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
572EF2111B51F12F00EEBB58 /* Build configuration list for PBXProject "Socket.IO-Client-Swift" */ = {
isa = XCConfigurationList;
buildConfigurations = (
572EF2121B51F12F00EEBB58 /* Debug */,
572EF2131B51F12F00EEBB58 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
572EF22D1B51F16C00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
572EF22E1B51F16C00EEBB58 /* Debug */,
572EF22F1B51F16C00EEBB58 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
572EF2301B51F16C00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-iOSTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
572EF2311B51F16C00EEBB58 /* Debug */,
572EF2321B51F16C00EEBB58 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
572EF24B1B51F18A00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-Mac" */ = {
isa = XCConfigurationList;
buildConfigurations = (
572EF24C1B51F18A00EEBB58 /* Debug */,
572EF24D1B51F18A00EEBB58 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
572EF24E1B51F18A00EEBB58 /* Build configuration list for PBXNativeTarget "SocketIO-MacTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
572EF24F1B51F18A00EEBB58 /* Debug */,
572EF2501B51F18A00EEBB58 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 572EF20E1B51F12F00EEBB58 /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Socket.IO-Client-Swift.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2371B51F18A00EEBB58"
BuildableName = "SocketIO-Mac.framework"
BlueprintName = "SocketIO-Mac"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2411B51F18A00EEBB58"
BuildableName = "SocketIO-MacTests.xctest"
BlueprintName = "SocketIO-MacTests"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2411B51F18A00EEBB58"
BuildableName = "SocketIO-MacTests.xctest"
BlueprintName = "SocketIO-MacTests"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2371B51F18A00EEBB58"
BuildableName = "SocketIO-Mac.framework"
BlueprintName = "SocketIO-Mac"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2371B51F18A00EEBB58"
BuildableName = "SocketIO-Mac.framework"
BlueprintName = "SocketIO-Mac"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2371B51F18A00EEBB58"
BuildableName = "SocketIO-Mac.framework"
BlueprintName = "SocketIO-Mac"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2181B51F16C00EEBB58"
BuildableName = "SocketIO-iOS.framework"
BlueprintName = "SocketIO-iOS"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2231B51F16C00EEBB58"
BuildableName = "SocketIO-iOSTests.xctest"
BlueprintName = "SocketIO-iOSTests"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2231B51F16C00EEBB58"
BuildableName = "SocketIO-iOSTests.xctest"
BlueprintName = "SocketIO-iOSTests"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2181B51F16C00EEBB58"
BuildableName = "SocketIO-iOS.framework"
BlueprintName = "SocketIO-iOS"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2181B51F16C00EEBB58"
BuildableName = "SocketIO-iOS.framework"
BlueprintName = "SocketIO-iOS"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "572EF2181B51F16C00EEBB58"
BuildableName = "SocketIO-iOS.framework"
BlueprintName = "SocketIO-iOS"
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>io.socket.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
+19
View File
@@ -0,0 +1,19 @@
//
// SocketIO-Mac.h
// SocketIO-Mac
//
// Created by Nacho Soto on 7/11/15.
//
//
#import <Cocoa/Cocoa.h>
//! Project version number for SocketIO-Mac.
FOUNDATION_EXPORT double SocketIO_MacVersionNumber;
//! Project version string for SocketIO-Mac.
FOUNDATION_EXPORT const unsigned char SocketIO_MacVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SocketIO_Mac/PublicHeader.h>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>io.socket.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
+36
View File
@@ -0,0 +1,36 @@
//
// SocketIO_MacTests.swift
// SocketIO-MacTests
//
// Created by Nacho Soto on 7/11/15.
//
//
import Cocoa
import XCTest
class SocketIO_MacTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>io.socket.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
+19
View File
@@ -0,0 +1,19 @@
//
// SocketIO-iOS.h
// SocketIO-iOS
//
// Created by Nacho Soto on 7/11/15.
//
//
#import <UIKit/UIKit.h>
//! Project version number for SocketIO-iOS.
FOUNDATION_EXPORT double SocketIO_iOSVersionNumber;
//! Project version string for SocketIO-iOS.
FOUNDATION_EXPORT const unsigned char SocketIO_iOSVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SocketIO_iOS/PublicHeader.h>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>io.socket.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
+36
View File
@@ -0,0 +1,36 @@
//
// SocketIO_iOSTests.swift
// SocketIO-iOSTests
//
// Created by Nacho Soto on 7/11/15.
//
//
import UIKit
import XCTest
class SocketIO_iOSTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
@@ -1,5 +1,5 @@
//
// SocketAckMap.swift
// SocketAckManager.swift
// SocketIO-Swift
//
// Created by Erik Little on 4/3/15.
@@ -24,32 +24,51 @@
import Foundation
struct SocketAckMap {
private var acks = [Int: AckCallback]()
private var waiting = [Int: Bool]()
private struct SocketAck: Hashable, Equatable {
let ack:Int
var callback:AckCallback!
var hashValue:Int {
return ack.hashValue
}
init(ack:Int) {
self.ack = ack
}
init(ack:Int, callback:AckCallback) {
self.ack = ack
self.callback = callback
}
}
private func <(lhs:SocketAck, rhs:SocketAck) -> Bool {
return lhs.ack < rhs.ack
}
private func ==(lhs:SocketAck, rhs:SocketAck) -> Bool {
return lhs.ack == rhs.ack
}
struct SocketAckManager {
private var acks = Set<SocketAck>(minimumCapacity: 1)
mutating func addAck(ack:Int, callback:AckCallback) {
waiting[ack] = true
acks[ack] = callback
acks.insert(SocketAck(ack: ack, callback: callback))
}
mutating func executeAck(ack:Int, items:[AnyObject]?) {
let callback = acks[ack]
waiting[ack] = false
let callback = acks.remove(SocketAck(ack: ack))
dispatch_async(dispatch_get_main_queue()) {
callback?(items)
callback?.callback(items)
}
acks.removeValueForKey(ack)
}
mutating func timeoutAck(ack:Int) {
if waiting[ack] != nil && waiting[ack]! {
acks[ack]?(["NO ACK"])
}
let callback = acks.remove(SocketAck(ack: ack))
acks.removeValueForKey(ack)
waiting.removeValueForKey(ack)
dispatch_async(dispatch_get_main_queue()) {
callback?.callback(["NO ACK"])
}
}
}
+3 -3
View File
@@ -26,10 +26,10 @@ import Foundation
@objc public final class SocketAnyEvent {
public let event:String!
public var items:[AnyObject]?
public let items:NSArray?
init(event:String, items:[AnyObject]?) {
init(event:String, items:NSArray?) {
self.event = event
self.items = items
}
}
}
File diff suppressed because it is too large. Load diff
+2 -7
View File
@@ -27,16 +27,11 @@ import Foundation
@objc public protocol SocketEngineClient {
var handleQueue:dispatch_queue_attr_t! {get}
var emitQueue:dispatch_queue_attr_t! {get}
var reconnecting:Bool {get}
var socketURL:String {get}
var secure:Bool {get}
func didError(reason:AnyObject)
func engineDidForceClose(reason:String)
func engineDidClose(reason:String)
func parseSocketMessage(msg:String)
func parseBinaryData(data:NSData)
func pollingDidFail(err:String)
func webSocketDidCloseWithCode(code:Int, reason:String)
func webSocketDidFailWithError(error:NSError)
}
}
+1 -2
View File
@@ -25,7 +25,6 @@
import Foundation
private func emitAckCallback(socket:SocketIOClient, num:Int)
// Curried
(items:AnyObject...) -> Void {
socket.emitAck(num, withData: items)
}
@@ -45,4 +44,4 @@ final class SocketEventHandler {
self?.callback?(items, ack != nil ? emitAckCallback(socket!, ack!) : nil)
}
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@
import Foundation
func fixDoubleUTF8(inout name:String) {
let utf8 = name.dataUsingEncoding(NSISOLatin1StringEncoding, allowLossyConversion: false)!
let utf8 = name.dataUsingEncoding(NSISOLatin1StringEncoding)!
let latin1 = NSString(data: utf8, encoding: NSUTF8StringEncoding)!
name = latin1 as String
}
+224 -228
View File
@@ -25,60 +25,57 @@
import Foundation
public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient {
private lazy var params = [String: AnyObject]()
private var anyHandler:((SocketAnyEvent) -> Void)?
private var _closed = false
private var _connected = false
private var _connecting = false
private var currentReconnectAttempt = 0
private var forcePolling = false
private var forceWebsockets = false
private var handlers = ContiguousArray<SocketEventHandler>()
private var paramConnect = false
private var connectParams:[String: AnyObject]?
private var _secure = false
private var _sid:String?
private var _reconnecting = false
private var reconnectTimer:NSTimer?
let reconnectAttempts:Int!
let logType = "SocketClient"
var ackHandlers = SocketAckMap()
var ackHandlers = SocketAckManager()
var currentAck = -1
var log = false
var waitingData = ContiguousArray<SocketPacket>()
var sessionDelegate:NSURLSessionDelegate?
public let socketURL:String
public let handleAckQueue = dispatch_queue_create("handleAckQueue", DISPATCH_QUEUE_SERIAL)
public let handleQueue = dispatch_queue_create("handleQueue", DISPATCH_QUEUE_SERIAL)
public let emitQueue = dispatch_queue_create("emitQueue", DISPATCH_QUEUE_SERIAL)
public var closed:Bool {
return self._closed
return _closed
}
public var connected:Bool {
return self._connected
return _connected
}
public var connecting:Bool {
return self._connecting
return _connecting
}
public var cookies:[NSHTTPCookie]?
public var engine:SocketEngine?
public var nsp = "/"
public var opts:[String: AnyObject]?
public var reconnects = true
public var reconnecting:Bool {
return self._reconnecting
return _reconnecting
}
public var reconnectWait = 10
public var secure:Bool {
return self._secure
return _secure
}
public var sid:String? {
return self._sid
return engine?.sid
}
/**
Create a new SocketIOClient. opts can be omitted
*/
public init(var socketURL:String, opts:NSDictionary? = nil) {
public init(var socketURL:String, opts:[String: AnyObject]? = nil) {
if socketURL["https://"].matches().count != 0 {
self._secure = true
}
@@ -87,65 +84,64 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
socketURL = socketURL["https://"] ~= ""
self.socketURL = socketURL
self.opts = opts
// Set options
if opts != nil {
if let cookies = opts!["cookies"] as? [NSHTTPCookie] {
self.cookies = cookies
if let sessionDelegate = opts?["sessionDelegate"] as? NSURLSessionDelegate {
self.sessionDelegate = sessionDelegate
}
if let connectParams = opts?["connectParams"] as? [String: AnyObject] {
self.connectParams = connectParams
}
if let log = opts?["log"] as? Bool {
self.log = log
}
if var nsp = opts?["nsp"] as? String {
if nsp != "/" && nsp.hasPrefix("/") {
nsp.removeAtIndex(nsp.startIndex)
}
if let log = opts!["log"] as? Bool {
self.log = log
}
if let polling = opts!["forcePolling"] as? Bool {
self.forcePolling = polling
}
if var nsp = opts!["nsp"] as? String {
if nsp != "/" && nsp.hasPrefix("/") {
nsp.removeAtIndex(nsp.startIndex)
}
self.nsp = nsp
}
if let reconnects = opts!["reconnects"] as? Bool {
self.reconnects = reconnects
}
if let reconnectAttempts = opts!["reconnectAttempts"] as? Int {
self.reconnectAttempts = reconnectAttempts
} else {
self.reconnectAttempts = -1
}
if let reconnectWait = opts!["reconnectWait"] as? Int {
self.reconnectWait = abs(reconnectWait)
}
if let ws = opts!["forceWebsockets"] as? Bool {
self.forceWebsockets = ws
}
self.nsp = nsp
}
if let reconnects = opts?["reconnects"] as? Bool {
self.reconnects = reconnects
}
if let reconnectAttempts = opts?["reconnectAttempts"] as? Int {
self.reconnectAttempts = reconnectAttempts
} else {
self.reconnectAttempts = -1
}
if let reconnectWait = opts?["reconnectWait"] as? Int {
self.reconnectWait = abs(reconnectWait)
}
super.init()
}
public convenience init(socketURL:String, options:NSDictionary?) {
public convenience init(socketURL:String, options:[String: AnyObject]?) {
self.init(socketURL: socketURL, opts: options)
}
deinit {
SocketLogger.log("Client is being deinit", client: self)
engine?.close(fast: true)
}
private func addEngine() {
SocketLogger.log("Adding engine", client: self)
self.engine = SocketEngine(client: self,
forcePolling: self.forcePolling,
forceWebsockets: self.forceWebsockets,
withCookies: self.cookies,
logging: self.log)
engine = SocketEngine(client: self, opts: opts)
}
private func clearReconnectTimer() {
reconnectTimer?.invalidate()
reconnectTimer = nil
}
/**
@@ -156,67 +152,68 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
public func close(#fast:Bool) {
SocketLogger.log("Closing socket", client: self)
self.reconnects = false
self._connecting = false
self._connected = false
self._reconnecting = false
self.engine?.close(fast: fast)
reconnects = false
_connecting = false
_connected = false
_reconnecting = false
engine?.close(fast: fast)
engine = nil
}
/**
Connect to the server.
*/
public func connect() {
if self.closed {
println("Warning! This socket was previously closed. This might be dangerous!")
self._closed = false
}
if self.connected {
return
}
self.addEngine()
self.engine?.open()
connect(timeoutAfter: 0, withTimeoutHandler: nil)
}
/**
Connect to the server with params that will be passed on connection.
Connect to the server. If we aren't connected after timeoutAfter, call handler
*/
public func connectWithParams(params:[String: AnyObject]) {
if self.closed {
println("Warning! This socket was previously closed. This might be dangerous!")
self._closed = false
}
if self.connected {
public func connect(#timeoutAfter:Int, withTimeoutHandler handler:(() -> Void)?) {
if closed {
SocketLogger.log("Warning! This socket was previously closed. This might be dangerous!", client: self)
_closed = false
} else if connected {
return
}
self.params = params
self.paramConnect = true
_connecting = true
addEngine()
engine?.open(opts: connectParams)
self.addEngine()
self.engine?.open(opts: params)
if timeoutAfter == 0 {
return
}
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeoutAfter) * Int64(NSEC_PER_SEC))
dispatch_after(time, dispatch_get_main_queue()) {[weak self] in
if let this = self where !this.connected {
this._closed = true
this._connecting = false
this.engine?.close(fast: true)
handler?()
}
}
}
private func createOnAck(event:String, items:[AnyObject]) -> OnAckCallback {
return {[weak self, ack = ++self.currentAck] timeout, callback in
if self == nil {
return
}
self?.ackHandlers.addAck(ack, callback: callback)
dispatch_async(self!.emitQueue) {
self?._emit(event, items, ack: ack)
}
if timeout != 0 {
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeout * NSEC_PER_SEC))
return {[weak self, ack = ++currentAck] timeout, callback in
if let this = self {
this.ackHandlers.addAck(ack, callback: callback)
dispatch_after(time, dispatch_get_main_queue()) {
self?.ackHandlers.timeoutAck(ack)
dispatch_async(this.emitQueue) {[weak this] in
this?._emit(event, items, ack: ack)
}
if timeout != 0 {
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeout * NSEC_PER_SEC))
dispatch_after(time, dispatch_get_main_queue()) {[weak this] in
this?.ackHandlers.timeoutAck(ack)
}
}
}
}
@@ -225,25 +222,41 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
func didConnect() {
SocketLogger.log("Socket connected", client: self)
self._closed = false
self._connected = true
self._connecting = false
self._reconnecting = false
self.currentReconnectAttempt = 0
self.reconnectTimer?.invalidate()
self.reconnectTimer = nil
self._sid = self.engine?.sid
_closed = false
_connected = true
_connecting = false
_reconnecting = false
currentReconnectAttempt = 0
clearReconnectTimer()
// Don't handle as internal because something crazy could happen where
// we disconnect before it's handled
self.handleEvent("connect", data: nil, isInternalMessage: false)
handleEvent("connect", data: nil, isInternalMessage: false)
}
func didDisconnect(reason:String) {
if closed {
return
}
SocketLogger.log("Disconnected: %@", client: self, args: reason)
_closed = true
_connected = false
reconnects = false
_connecting = false
_reconnecting = false
// Make sure the engine is actually dead.
engine?.close(fast: true)
handleEvent("disconnect", data: [reason], isInternalMessage: true)
}
/// error
public func didError(reason:AnyObject) {
SocketLogger.err("Error", client: self)
SocketLogger.err("%@", client: self, args: reason)
self.handleEvent("error", data: reason as? [AnyObject] ?? [reason],
handleEvent("error", data: reason as? [AnyObject] ?? [reason],
isInternalMessage: true)
}
@@ -251,18 +264,18 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
Same as close
*/
public func disconnect(#fast:Bool) {
self.close(fast: fast)
close(fast: fast)
}
/**
Send a message to the server
*/
public func emit(event:String, _ items:AnyObject...) {
if !self.connected {
if !connected {
return
}
dispatch_async(self.emitQueue) {[weak self] in
dispatch_async(emitQueue) {[weak self] in
self?._emit(event, items)
}
}
@@ -270,12 +283,12 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
/**
Same as emit, but meant for Objective-C
*/
public func emitObjc(event:String, withItems items:[AnyObject]) {
if !self.connected {
public func emit(event:String, withItems items:[AnyObject]) {
if !connected {
return
}
dispatch_async(self.emitQueue) {[weak self] in
dispatch_async(emitQueue) {[weak self] in
self?._emit(event, items)
}
}
@@ -285,88 +298,84 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
an ack.
*/
public func emitWithAck(event:String, _ items:AnyObject...) -> OnAckCallback {
if !self.connected {
if !connected {
return createOnAck(event, items: items)
}
return self.createOnAck(event, items: items)
return createOnAck(event, items: items)
}
/**
Same as emitWithAck, but for Objective-C
*/
public func emitWithAckObjc(event:String, withItems items:[AnyObject]) -> OnAckCallback {
if !self.connected {
return self.createOnAck(event, items: items)
public func emitWithAck(event:String, withItems items:[AnyObject]) -> OnAckCallback {
if !connected {
return createOnAck(event, items: items)
}
return self.createOnAck(event, items: items)
return createOnAck(event, items: items)
}
private func _emit(event:String, _ args:[AnyObject], ack:Int? = nil) {
if !self.connected {
if !connected {
return
}
let packet = SocketPacket(type: nil, data: args, nsp: self.nsp, id: ack)
let packet = SocketPacket(type: nil, data: args, nsp: nsp, id: ack)
let str:String
SocketParser.parseForEmit(packet)
str = packet.createMessageForEvent(event)
SocketLogger.log("Emitting: \(str)", client: self)
SocketLogger.log("Emitting: %@", client: self, args: str)
if packet.type == SocketPacket.PacketType.BINARY_EVENT {
self.engine?.send(str, withData: packet.binary)
engine?.send(str, withData: packet.binary)
} else {
self.engine?.send(str, withData: nil)
engine?.send(str, withData: nil)
}
}
// If the server wants to know that the client received data
func emitAck(ack:Int, withData args:[AnyObject]) {
dispatch_async(self.emitQueue) {[weak self] in
if self == nil || !self!.connected {
return
}
let packet = SocketPacket(type: nil, data: args, nsp: self!.nsp, id: ack)
let str:String
SocketParser.parseForEmit(packet)
str = packet.createAck()
SocketLogger.log("Emitting Ack: \(str)", client: self!)
if packet.type == SocketPacket.PacketType.BINARY_ACK {
self?.engine?.send(str, withData: packet.binary)
} else {
self?.engine?.send(str, withData: nil)
dispatch_async(emitQueue) {[weak self] in
if let this = self where this.connected {
let packet = SocketPacket(type: nil, data: args, nsp: this.nsp, id: ack)
let str:String
SocketParser.parseForEmit(packet)
str = packet.createAck()
SocketLogger.log("Emitting Ack: %@", client: this, args: str)
if packet.type == SocketPacket.PacketType.BINARY_ACK {
this.engine?.send(str, withData: packet.binary)
} else {
this.engine?.send(str, withData: nil)
}
}
}
}
/// Server wants us to die
public func engineDidForceClose(reason:String) {
if self.closed {
return
public func engineDidClose(reason:String) {
_connected = false
_connecting = false
if closed || !reconnects {
didDisconnect(reason)
} else if !reconnecting {
handleEvent("reconnect", data: [reason], isInternalMessage: true)
tryReconnect()
}
SocketLogger.log("Engine closed", client: self)
self._closed = true
self._connected = false
self.reconnects = false
self._connecting = false
self._reconnecting = false
self.handleEvent("disconnect", data: [reason], isInternalMessage: true)
}
// Called when the socket gets an ack for something it sent
func handleAck(ack:Int, data:AnyObject?) {
SocketLogger.log("Handling ack: \(ack) with data: \(data)", client: self)
SocketLogger.log("Handling ack: %@ with data: %@", client: self,
args: ack, data ?? "")
self.ackHandlers.executeAck(ack,
ackHandlers.executeAck(ack,
items: (data as? [AnyObject]?) ?? (data != nil ? [data!] : nil))
}
@@ -376,19 +385,20 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
public func handleEvent(event:String, data:[AnyObject]?, isInternalMessage:Bool = false,
wantsAck ack:Int? = nil) {
// println("Should do event: \(event) with data: \(data)")
if !self.connected && !isInternalMessage {
if !connected && !isInternalMessage {
return
}
SocketLogger.log("Handling event: \(event) with data: \(data)", client: self)
SocketLogger.log("Handling event: %@ with data: %@", client: self,
args: event, data ?? "")
if self.anyHandler != nil {
if anyHandler != nil {
dispatch_async(dispatch_get_main_queue()) {[weak self] in
self?.anyHandler?(SocketAnyEvent(event: event, items: data))
}
}
for handler in self.handlers {
for handler in handlers {
if handler.event == event {
if ack != nil {
handler.executeCallback(data, withAck: ack!, withSocket: self)
@@ -399,11 +409,24 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
}
}
func joinNamespace() {
/**
Leaves nsp and goes back to /
*/
public func leaveNamespace() {
if nsp != "/" {
engine?.send("1/\(nsp)", withData: nil)
nsp = "/"
}
}
/**
Joins nsp if it is not /
*/
public func joinNamespace() {
SocketLogger.log("Joining namespace", client: self)
if self.nsp != "/" {
self.engine?.send("0/\(self.nsp)", withData: nil)
if nsp != "/" {
engine?.send("0/\(nsp)", withData: nil)
}
}
@@ -411,33 +434,33 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
Removes handler(s)
*/
public func off(event:String) {
SocketLogger.log("Removing handler for event: \(event)", client: self)
SocketLogger.log("Removing handler for event: %@", client: self, args: event)
self.handlers = self.handlers.filter {$0.event == event ? false : true}
handlers = handlers.filter {$0.event == event ? false : true}
}
/**
Adds a handler for an event.
*/
public func on(name:String, callback:NormalCallback) {
SocketLogger.log("Adding handler for event: \(name)", client: self)
public func on(event:String, callback:NormalCallback) {
SocketLogger.log("Adding handler for event: %@", client: self, args: event)
let handler = SocketEventHandler(event: name, callback: callback)
self.handlers.append(handler)
let handler = SocketEventHandler(event: event, callback: callback)
handlers.append(handler)
}
/**
Adds a handler that will be called on every event.
*/
public func onAny(handler:(SocketAnyEvent) -> Void) {
self.anyHandler = handler
anyHandler = handler
}
/**
Same as connect
*/
public func open() {
self.connect()
connect()
}
public func parseSocketMessage(msg:String) {
@@ -448,76 +471,49 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
SocketParser.parseBinaryData(data, socket: self)
}
// Something happened while polling
public func pollingDidFail(err:String) {
if !self.reconnecting {
self._connected = false
self.handleEvent("reconnect", data: [err], isInternalMessage: true)
self.tryReconnect()
}
/**
Trieds to reconnect to the server.
*/
public func reconnect() {
_connected = false
_connecting = false
_reconnecting = false
engine?.stopPolling()
tryReconnect()
}
// We lost connection and should attempt to reestablish
func tryReconnect() {
if self.reconnectAttempts != -1 && self.currentReconnectAttempt + 1 > self.reconnectAttempts {
self.engineDidForceClose("Reconnect Failed")
@objc private func tryReconnect() {
if reconnectAttempts != -1 && currentReconnectAttempt + 1 > reconnectAttempts || !reconnects {
clearReconnectTimer()
didDisconnect("Reconnect Failed")
return
} else if self.connected {
self._connecting = false
self._reconnecting = false
} else if connected {
_connecting = false
_reconnecting = false
return
}
if self.reconnectTimer == nil {
if reconnectTimer == nil {
SocketLogger.log("Starting reconnect", client: self)
self._reconnecting = true
_reconnecting = true
dispatch_async(dispatch_get_main_queue()) {[weak self] in
if self == nil {
return
if let this = self {
this.reconnectTimer = NSTimer.scheduledTimerWithTimeInterval(Double(this.reconnectWait),
target: this, selector: "tryReconnect", userInfo: nil, repeats: true)
}
self?.reconnectTimer = NSTimer.scheduledTimerWithTimeInterval(Double(self!.reconnectWait),
target: self!, selector: "tryReconnect", userInfo: nil, repeats: true)
return
}
}
SocketLogger.log("Trying to reconnect", client: self)
self.handleEvent("reconnectAttempt", data: [self.reconnectAttempts - self.currentReconnectAttempt],
handleEvent("reconnectAttempt", data: [reconnectAttempts - currentReconnectAttempt],
isInternalMessage: true)
self.currentReconnectAttempt++
if self.paramConnect {
self.connectWithParams(self.params)
} else {
self.connect()
}
currentReconnectAttempt++
connect()
}
// Called when the socket is closed
public func webSocketDidCloseWithCode(code:Int, reason:String) {
self._connected = false
self._connecting = false
if self.closed || !self.reconnects {
self.engineDidForceClose("WebSocket closed")
} else if !self.reconnecting {
self.handleEvent("reconnect", data: [reason], isInternalMessage: true)
self.tryReconnect()
}
}
// Called when an error occurs.
public func webSocketDidFailWithError(error:NSError) {
self._connected = false
self._connecting = false
self.handleEvent("error", data: [error.localizedDescription], isInternalMessage: true)
if self.closed || !self.reconnects {
self.engineDidForceClose("WebSocket closed with an error \(error)")
} else if !self.reconnecting {
self.handleEvent("reconnect", data: [error.localizedDescription], isInternalMessage: true)
self.tryReconnect()
}
}
}
}
+36 -6
View File
@@ -24,21 +24,51 @@
import Foundation
private let MESSAGE_LENGTH_MAX = 10000
protocol SocketLogClient {
var log:Bool {get set}
var logType:String {get}
}
final class SocketLogger {
static func log(message:String, client:SocketLogClient, altType:String? = nil) {
if client.log {
NSLog("%@: %@", altType ?? client.logType, message)
private static let printQueue = dispatch_queue_create("printQueue", DISPATCH_QUEUE_SERIAL)
private static func shorten(item:AnyObject) -> CVarArgType {
var str = toString(item)
if count(str) > MESSAGE_LENGTH_MAX {
let endIndex = advance(str.startIndex, MESSAGE_LENGTH_MAX)
str = str.substringToIndex(endIndex)
}
return str
}
static func log(message:String, client:SocketLogClient, altType:String? = nil, args:AnyObject...) {
if !client.log {
return
}
dispatch_async(printQueue) {[type = client.logType] in
let newArgs = args.map(SocketLogger.shorten)
let replaced = String(format: message, arguments: newArgs)
NSLog("%@: %@", altType ?? type, replaced)
}
}
static func err(message:String, client:SocketLogClient, altType:String? = nil) {
if client.log {
NSLog("ERROR %@: %@", altType ?? client.logType, message)
static func err(message:String, client:SocketLogClient, altType:String? = nil, args:AnyObject...) {
if !client.log {
return
}
dispatch_async(printQueue) {[type = client.logType] in
let newArgs = args.map(SocketLogger.shorten)
let replaced = String(format: message, arguments: newArgs)
NSLog("ERROR %@: %@", altType ?? type, replaced)
}
}
}
+85 -98
View File
@@ -32,10 +32,10 @@ final class SocketPacket: Printable {
var better = "SocketPacket {type: ~~0; data: ~~1; " +
"id: ~~2; placeholders: ~~3;}"
better = better["~~0"] ~= (self.type != nil ? String(self.type!.rawValue) : "nil")
better = better["~~1"] ~= (self.data != nil ? "\(self.data!)" : "nil")
better = better["~~2"] ~= (self.id != nil ? String(self.id!) : "nil")
better = better["~~3"] ~= (self.placeholders != nil ? String(self.placeholders!) : "nil")
better = better["~~0"] ~= (type != nil ? String(type!.rawValue) : "nil")
better = better["~~1"] ~= (data != nil ? "\(data!)" : "nil")
better = better["~~2"] ~= (id != nil ? String(id!) : "nil")
better = better["~~3"] ~= (placeholders != nil ? String(placeholders!) : "nil")
return better
}
@@ -55,14 +55,14 @@ final class SocketPacket: Printable {
case BINARY_ACK = 6
init?(str:String) {
if let int = str.toInt(), let raw = PacketType(rawValue: int) {
if let int = str.toInt(), raw = PacketType(rawValue: int) {
self = raw
} else {
return nil
}
}
}
init(type:PacketType?, data:[AnyObject]? = nil, nsp:String = "",
placeholders:Int? = nil, id:Int? = nil) {
self.type = type
@@ -71,175 +71,162 @@ final class SocketPacket: Printable {
self.placeholders = placeholders
self.id = id
}
func getEvent() -> String {
return data?.removeAtIndex(0) as! String
}
func addData(data:NSData) -> Bool {
func checkDoEvent() -> Bool {
if self.placeholders == self.currentPlace {
return true
} else {
return false
}
}
if checkDoEvent() {
if placeholders == currentPlace {
return true
}
self.binary.append(data)
self.currentPlace++
if checkDoEvent() {
self.currentPlace = 0
binary.append(data)
currentPlace++
if placeholders == currentPlace {
currentPlace = 0
return true
} else {
return false
}
}
func createMessageForEvent(event:String) -> String {
let message:String
var jsonSendError:NSError?
if self.binary.count == 0 {
self.type = PacketType.EVENT
if self.nsp == "/" {
if self.id == nil {
if binary.count == 0 {
type = PacketType.EVENT
if nsp == "/" {
if id == nil {
message = "2[\"\(event)\""
} else {
message = "2\(self.id!)[\"\(event)\""
message = "2\(id!)[\"\(event)\""
}
} else {
if self.id == nil {
message = "2/\(self.nsp),[\"\(event)\""
if id == nil {
message = "2/\(nsp),[\"\(event)\""
} else {
message = "2/\(self.nsp),\(self.id!)[\"\(event)\""
message = "2/\(nsp),\(id!)[\"\(event)\""
}
}
} else {
self.type = PacketType.BINARY_EVENT
if self.nsp == "/" {
if self.id == nil {
message = "5\(self.binary.count)-[\"\(event)\""
type = PacketType.BINARY_EVENT
if nsp == "/" {
if id == nil {
message = "5\(binary.count)-[\"\(event)\""
} else {
message = "5\(self.binary.count)-\(self.id!)[\"\(event)\""
message = "5\(binary.count)-\(id!)[\"\(event)\""
}
} else {
if self.id == nil {
message = "5\(self.binary.count)-/\(self.nsp),[\"\(event)\""
if id == nil {
message = "5\(binary.count)-/\(nsp),[\"\(event)\""
} else {
message = "5\(self.binary.count)-/\(self.nsp),\(self.id!)[\"\(event)\""
message = "5\(binary.count)-/\(nsp),\(id!)[\"\(event)\""
}
}
}
return self.completeMessage(message)
return completeMessage(message)
}
func createAck() -> String {
var msg:String
if self.binary.count == 0 {
self.type = PacketType.ACK
if binary.count == 0 {
type = PacketType.ACK
if nsp == "/" {
msg = "3\(self.id!)["
msg = "3\(id!)["
} else {
msg = "3/\(self.nsp),\(self.id!)["
msg = "3/\(nsp),\(id!)["
}
} else {
self.type = PacketType.BINARY_ACK
type = PacketType.BINARY_ACK
if nsp == "/" {
msg = "6\(self.binary.count)-\(self.id!)["
msg = "6\(binary.count)-\(id!)["
} else {
msg = "6\(self.binary.count)-/\(self.nsp),\(self.id!)["
msg = "6\(binary.count)-/\(nsp),\(id!)["
}
}
return self.completeMessage(msg, ack: true)
return completeMessage(msg, ack: true)
}
func completeMessage(var message:String, ack:Bool = false) -> String {
private func completeMessage(var message:String, ack:Bool = false) -> String {
var err:NSError?
if self.data == nil || self.data!.count == 0 {
if data == nil || data!.count == 0 {
return message + "]"
} else if !ack {
message += ","
}
for arg in self.data! {
for arg in data! {
if arg is NSDictionary || arg is [AnyObject] {
let jsonSend = NSJSONSerialization.dataWithJSONObject(arg,
options: NSJSONWritingOptions(0), error: &err)
let jsonString = NSString(data: jsonSend!, encoding: NSUTF8StringEncoding)
message += jsonString! as String
message += ","
continue
message += jsonString! as String + ","
} else if var str = arg as? String {
str = str["\n"] ~= "\\\\n"
str = str["\r"] ~= "\\\\r"
message += "\"\(str)\","
} else if arg is NSNull {
message += "null,"
} else {
message += "\(arg),"
}
if arg is String {
message += "\"\(arg)\""
message += ","
continue
}
message += "\(arg)"
message += ","
}
if message != "" {
message.removeAtIndex(message.endIndex.predecessor())
}
return message + "]"
}
func fillInPlaceholders() {
var newArr = NSMutableArray(array: self.data!)
for i in 0..<self.data!.count {
if let str = self.data?[i] as? String {
if let num = str["~~(\\d)"].groups() {
newArr[i] = self.binary[num[1].toInt()!]
}
} else if self.data?[i] is NSDictionary || self.data?[i] is NSArray {
newArr[i] = self._fillInPlaceholders(self.data![i])
var newArr = NSMutableArray(array: data!)
for i in 0..<data!.count {
if let str = data?[i] as? String, num = str["~~(\\d)"].groups() {
newArr[i] = binary[num[1].toInt()!]
} else if data?[i] is NSDictionary || data?[i] is NSArray {
newArr[i] = _fillInPlaceholders(data![i])
}
}
self.data = newArr as [AnyObject]
data = newArr as [AnyObject]
}
private func _fillInPlaceholders(data:AnyObject) -> AnyObject {
if let str = data as? String {
if let num = str["~~(\\d)"].groups() {
return self.binary[num[1].toInt()!]
return binary[num[1].toInt()!]
} else {
return str
}
} else if let dict = data as? NSDictionary {
var newDict = NSMutableDictionary(dictionary: dict)
for (key, value) in dict {
newDict[key as! NSCopying] = _fillInPlaceholders(value)
}
return newDict
} else if let arr = data as? NSArray {
var newArr = NSMutableArray(array: arr)
for i in 0..<arr.count {
newArr[i] = _fillInPlaceholders(arr[i])
}
return newArr
} else {
return data
+8 -14
View File
@@ -103,11 +103,11 @@ class SocketParser {
}
}
if buf.toInt() == nil || arr[i] != "-" {
if let holders = buf.toInt() where arr[i] == "-" {
placeholders = holders
} else {
NSLog("Error parsing \(str)")
return nil
} else {
placeholders = buf.toInt()!
}
}
@@ -145,7 +145,7 @@ class SocketParser {
}
if ++i < arr.count {
let d = String(arr[i...arr.count-1])
let d = str[advance(str.startIndex, i)...advance(str.startIndex, count(str)-1)]
let noPlaceholders = d["(\\{\"_placeholder\":true,\"num\":(\\d*)\\})"] ~= "\"~~$2\""
let data = SocketParser.parseData(noPlaceholders) as? [AnyObject] ?? [noPlaceholders]
@@ -161,7 +161,7 @@ class SocketParser {
var err:NSError?
let stringData = data.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
let parsed:AnyObject? = NSJSONSerialization.JSONObjectWithData(stringData!,
options: NSJSONReadingOptions.AllowFragments, error: &err)
options: NSJSONReadingOptions.MutableContainers, error: &err)
if err != nil {
// println(err)
@@ -185,7 +185,7 @@ class SocketParser {
return nsp == "" && socket.nsp != "/"
}
SocketLogger.log("Parsing \(stringMessage)", client: socket, altType: "SocketParser")
SocketLogger.log("Parsing %@", client: socket, altType: "SocketParser", args: stringMessage)
let p:SocketPacket
@@ -196,10 +196,7 @@ class SocketParser {
return
}
// Don't call SocketPacket.description unless we need to
if socket.log {
SocketLogger.log("Decoded packet as: \(p)", client: socket, altType: "SocketParser")
}
SocketLogger.log("Decoded packet as: %@", client: socket, altType: "SocketParser", args: p)
if p.type == SocketPacket.PacketType.EVENT {
if checkNSP(p.nsp) {
@@ -236,16 +233,13 @@ class SocketParser {
socket.didConnect()
}
} else if p.type == SocketPacket.PacketType.DISCONNECT {
socket.engineDidForceClose("Got Disconnect")
socket.didDisconnect("Got Disconnect")
} else if p.type == SocketPacket.PacketType.ERROR {
socket.didError(p.data == nil ? "Error" : p.data!)
}
}
// Handles binary data
static func parseBinaryData(data:NSData, socket:SocketIOClient) {
// NSLog(data.base64EncodedStringWithOptions(NSDataBase64EncodingOptions.allZeros))
if socket.waitingData.count == 0 {
SocketLogger.err("Got data when not remaking packet", client: socket, altType: "SocketParser")
return
+1 -1
View File
@@ -31,4 +31,4 @@ import Foundation
public typealias AckCallback = @objc_block (NSArray?) -> Void
public typealias AckEmitter = (AnyObject...) -> Void
public typealias NormalCallback = (NSArray?, AckEmitter?) -> Void
public typealias OnAckCallback = (timeout:UInt64, callback:AckCallback) -> Void
public typealias OnAckCallback = (timeout:UInt64, callback:AckCallback) -> Void
+1 -1
View File
@@ -152,7 +152,7 @@ public class SwiftRegex: NSObject, BooleanType {
pos = matchRange.location + matchRange.length
}
out.appendString(substring( NSRange(location:pos, length:targetRange.length-pos))!)
out.appendString(substring(NSRange(location:pos, length:targetRange.length-pos))!)
return out as String
}
+19 -5
View File
@@ -78,6 +78,7 @@ public class WebSocket : NSObject, NSStreamDelegate {
var buffer: NSMutableData?
}
private var cookies:[NSHTTPCookie]?
public weak var delegate: WebSocketDelegate?
private var url: NSURL
private var inputStream: NSInputStream?
@@ -103,6 +104,11 @@ public class WebSocket : NSObject, NSStreamDelegate {
public init(url: NSURL) {
self.url = url
}
public convenience init(url: NSURL, cookies:[NSHTTPCookie]?) {
self.init(url: url)
self.cookies = cookies
}
//used for setting protocols.
public convenience init(url: NSURL, protocols: Array<String>) {
self.init(url: url)
@@ -175,6 +181,14 @@ public class WebSocket : NSObject, NSStreamDelegate {
port = 80
}
}
if self.cookies != nil {
let headers = NSHTTPCookie.requestHeaderFieldsWithCookies(self.cookies!)
for (key, value) in headers {
self.addHeader(urlRequest, key: key as! String, val: value as! String)
}
}
self.addHeader(urlRequest, key: headerWSUpgradeName, val: headerWSUpgradeValue)
self.addHeader(urlRequest, key: headerWSConnectionName, val: headerWSConnectionValue)
if let protocols = optionalProtocols {
@@ -368,13 +382,13 @@ public class WebSocket : NSObject, NSStreamDelegate {
///validates the HTTP is a 101 as per the RFC spec
private func validateResponse(buffer: UnsafePointer<UInt8>, bufferLen: Int) -> Bool {
let response = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, 0)
CFHTTPMessageAppendBytes(response.takeUnretainedValue(), buffer, bufferLen)
if CFHTTPMessageGetResponseStatusCode(response.takeUnretainedValue()) != 101 {
let response = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, 0).takeRetainedValue()
CFHTTPMessageAppendBytes(response, buffer, bufferLen)
if CFHTTPMessageGetResponseStatusCode(response) != 101 {
return false
}
let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response.takeUnretainedValue())
let headers: NSDictionary = cfHeaders.takeUnretainedValue()
let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response)
let headers: NSDictionary = cfHeaders.takeRetainedValue()
let acceptKey = headers[headerWSAcceptName] as! NSString
if acceptKey.length > 0 {
return true