Skip to content

Commit

Permalink
(#190) reconnect SSE on err
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldart committed Jul 28, 2015
1 parent bfe7739 commit c09430a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 27 deletions.
20 changes: 10 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- AFNetworking (2.1.0):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/UIKit
- AFNetworking/NSURLConnection (= 2.1.0)
- AFNetworking/NSURLSession (= 2.1.0)
- AFNetworking/Reachability (= 2.1.0)
- AFNetworking/Security (= 2.1.0)
- AFNetworking/Serialization (= 2.1.0)
- AFNetworking/UIKit (= 2.1.0)
- AFNetworking/NSURLConnection (2.1.0):
- AFNetworking/Reachability
- AFNetworking/Security
Expand All @@ -26,8 +26,8 @@ DEPENDENCIES:
- SocketRocket (= 0.3.1-beta2)

SPEC CHECKSUMS:
AFNetworking: c7d7901a83f631414c7eda1737261f696101a5cd
OCMock: ffba68873fd32cfd35d885bddad23bfa816da4a3
SocketRocket: 7ac946bcce46287a791dfff3c1f8daa692821dae
AFNetworking: d397c9a76a60c670cbcd33f3ff2c5f961f724cbc
OCMock: c8b8928d457c8f1873d563537ab1cc31bef40b87
SocketRocket: 7284ab9370a06c99aba92b2fe3a32aedd0f9a6fa

COCOAPODS: 0.29.0
COCOAPODS: 0.37.2
44 changes: 29 additions & 15 deletions SignalR.Client.ObjC/SignalR.Client.ObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
036198E3EF3A4AB9A00C08B9 /* Pods-SignalR.Client.iOS.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.iOS.xcconfig"; path = "../Pods/Pods-SignalR.Client.iOS.xcconfig"; sourceTree = SOURCE_ROOT; };
09893F87C8C94DFD96B7E8EC /* libPods-SignalR.Client.Tests.OSX.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SignalR.Client.Tests.OSX.a"; sourceTree = BUILT_PRODUCTS_DIR; };
0D4E148135DC73339395F50E /* Pods-SignalR.Client.OSX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.OSX.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-SignalR.Client.OSX/Pods-SignalR.Client.OSX.debug.xcconfig"; sourceTree = "<group>"; };
2526AA83173A4BCF8707E847 /* libPods-SignalR.Client.OSX.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SignalR.Client.OSX.a"; sourceTree = BUILT_PRODUCTS_DIR; };
28CD7529FF074ADAAD285BB4 /* Pods-SignalR.Client.Tests.OSX.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.Tests.OSX.xcconfig"; path = "../Pods/Pods-SignalR.Client.Tests.OSX.xcconfig"; sourceTree = "<group>"; };
2D64C09D8DB7E1E9D9282AD1 /* Pods-SignalR.Client.OSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.OSX.release.xcconfig"; path = "../Pods/Target Support Files/Pods-SignalR.Client.OSX/Pods-SignalR.Client.OSX.release.xcconfig"; sourceTree = "<group>"; };
3903084A173C660E00FE660E /* SRHeartbeatMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRHeartbeatMonitor.h; sourceTree = "<group>"; };
3903084B173C660E00FE660E /* SRHeartbeatMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRHeartbeatMonitor.m; sourceTree = "<group>"; };
3919634415AF1EC100DDC946 /* SignalR.Samples.OSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SignalR.Samples.OSX.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -330,8 +330,11 @@
39F7D7AE1833FC99002590A6 /* SRServerSentEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRServerSentEvent.h; sourceTree = "<group>"; };
39F7D7AF1833FC99002590A6 /* SRServerSentEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRServerSentEvent.m; sourceTree = "<group>"; };
39FA64281891654500C035DC /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6967368C934C142727A4A9C0 /* Pods-SignalR.Client.iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.iOS.release.xcconfig"; path = "../Pods/Target Support Files/Pods-SignalR.Client.iOS/Pods-SignalR.Client.iOS.release.xcconfig"; sourceTree = "<group>"; };
8CFF876916E13FF500B67FCA /* SRHubConnectionInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SRHubConnectionInterface.h; sourceTree = "<group>"; };
E1168910CBED44F49353CF85 /* Pods-SignalR.Client.OSX.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.OSX.xcconfig"; path = "../Pods/Pods-SignalR.Client.OSX.xcconfig"; sourceTree = SOURCE_ROOT; };
91FEE5E4D041DB1A146160EF /* Pods-SignalR.Client.Tests.OSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.Tests.OSX.release.xcconfig"; path = "../Pods/Target Support Files/Pods-SignalR.Client.Tests.OSX/Pods-SignalR.Client.Tests.OSX.release.xcconfig"; sourceTree = "<group>"; };
CF4802ED18CD82E41B1A684C /* Pods-SignalR.Client.iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.iOS.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-SignalR.Client.iOS/Pods-SignalR.Client.iOS.debug.xcconfig"; sourceTree = "<group>"; };
D3DFD069832BDB241B6BE0C1 /* Pods-SignalR.Client.Tests.OSX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR.Client.Tests.OSX.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-SignalR.Client.Tests.OSX/Pods-SignalR.Client.Tests.OSX.debug.xcconfig"; sourceTree = "<group>"; };
F9E09B8C504C4E1BBE289746 /* libPods-SignalR.Client.iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SignalR.Client.iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -477,9 +480,7 @@
3919634C15AF1EC200DDC946 /* SignalR.Samples.OSX */,
3920780915AF13C3009B959E /* Frameworks */,
3920780815AF13C3009B959E /* Products */,
036198E3EF3A4AB9A00C08B9 /* Pods-SignalR.Client.iOS.xcconfig */,
E1168910CBED44F49353CF85 /* Pods-SignalR.Client.OSX.xcconfig */,
28CD7529FF074ADAAD285BB4 /* Pods-SignalR.Client.Tests.OSX.xcconfig */,
B23287387AA8375589B08CAB /* Pods */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -741,6 +742,19 @@
name = SignalR.Client.Tests;
sourceTree = "<group>";
};
B23287387AA8375589B08CAB /* Pods */ = {
isa = PBXGroup;
children = (
0D4E148135DC73339395F50E /* Pods-SignalR.Client.OSX.debug.xcconfig */,
2D64C09D8DB7E1E9D9282AD1 /* Pods-SignalR.Client.OSX.release.xcconfig */,
D3DFD069832BDB241B6BE0C1 /* Pods-SignalR.Client.Tests.OSX.debug.xcconfig */,
91FEE5E4D041DB1A146160EF /* Pods-SignalR.Client.Tests.OSX.release.xcconfig */,
CF4802ED18CD82E41B1A684C /* Pods-SignalR.Client.iOS.debug.xcconfig */,
6967368C934C142727A4A9C0 /* Pods-SignalR.Client.iOS.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -1024,7 +1038,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Pods-SignalR.Client.Tests.OSX-resources.sh\"\n";
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.Tests.OSX/Pods-SignalR.Client.Tests.OSX-resources.sh\"\n";
showEnvVarsInLog = 0;
};
391963DE15AF25EC00DDC946 /* ShellScript */ = {
Expand Down Expand Up @@ -1078,7 +1092,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Pods-SignalR.Client.iOS-resources.sh\"\n";
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.iOS/Pods-SignalR.Client.iOS-resources.sh\"\n";
};
EE865CD5D57C4E9B9D114773 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -1092,7 +1106,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Pods-SignalR.Client.OSX-resources.sh\"\n";
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.OSX/Pods-SignalR.Client.OSX-resources.sh\"\n";
};
F4D7BEBC9AD74031A7814F3F /* Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -1341,7 +1355,7 @@
};
3919637715AF205300DDC946 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E1168910CBED44F49353CF85 /* Pods-SignalR.Client.OSX.xcconfig */;
baseConfigurationReference = 0D4E148135DC73339395F50E /* Pods-SignalR.Client.OSX.debug.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -1372,7 +1386,7 @@
};
3919637815AF205300DDC946 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E1168910CBED44F49353CF85 /* Pods-SignalR.Client.OSX.xcconfig */;
baseConfigurationReference = 2D64C09D8DB7E1E9D9282AD1 /* Pods-SignalR.Client.OSX.release.xcconfig */;
buildSettings = {
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1480,7 +1494,7 @@
};
3920781515AF13C3009B959E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 036198E3EF3A4AB9A00C08B9 /* Pods-SignalR.Client.iOS.xcconfig */;
baseConfigurationReference = CF4802ED18CD82E41B1A684C /* Pods-SignalR.Client.iOS.debug.xcconfig */;
buildSettings = {
DSTROOT = /tmp/SignalR_Client_iOS.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand All @@ -1495,7 +1509,7 @@
};
3920781615AF13C3009B959E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 036198E3EF3A4AB9A00C08B9 /* Pods-SignalR.Client.iOS.xcconfig */;
baseConfigurationReference = 6967368C934C142727A4A9C0 /* Pods-SignalR.Client.iOS.release.xcconfig */;
buildSettings = {
DSTROOT = /tmp/SignalR_Client_iOS.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand Down Expand Up @@ -1541,7 +1555,7 @@
};
39E6FCE715C6BDC600434098 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 28CD7529FF074ADAAD285BB4 /* Pods-SignalR.Client.Tests.OSX.xcconfig */;
baseConfigurationReference = D3DFD069832BDB241B6BE0C1 /* Pods-SignalR.Client.Tests.OSX.debug.xcconfig */;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -1565,7 +1579,7 @@
};
39E6FCE815C6BDC600434098 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 28CD7529FF074ADAAD285BB4 /* Pods-SignalR.Client.Tests.OSX.xcconfig */;
baseConfigurationReference = 91FEE5E4D041DB1A146160EF /* Pods-SignalR.Client.Tests.OSX.release.xcconfig */;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
4 changes: 2 additions & 2 deletions SignalR.Client/Transports/SRServerSentEventsTransport.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ - (void)open:(id <SRConnectionInterface>)connection connectionData:(NSString *)c
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
__strong __typeof(&*weakSelf)strongSelf = weakSelf;
__strong __typeof(&*weakConnection)strongConnection = weakConnection;
if (strongSelf.completionHandler) {
if (strongSelf.completionHandler) {//this is equivalent to the !reconnecting onStartFailed from c#
strongSelf.completionHandler(nil, error);
strongSelf.completionHandler = nil;
} else if (!_stop && reconnecting) {
} else if (!_stop) {
[strongConnection didReceiveError:error];
[strongSelf reconnect:strongConnection data:connectionData];
}
Expand Down

0 comments on commit c09430a

Please sign in to comment.