Skip to content

Commit

Permalink
#300 only trigger reconnect on initialized
Browse files Browse the repository at this point in the history
- left out an important change for 300: moving the reconnect logic
exclusively to the message + initialized loop. prior code didn’t
actually change anything
  • Loading branch information
joeldart committed Dec 12, 2018
1 parent 09460fd commit 6550e5e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions SignalR.Client/Transports/SRServerSentEventsTransport.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,7 @@ - (void)open:(id <SRConnectionInterface>)connection connectionData:(NSString *)c
//operation.securityPolicy = self.securityPolicy;
_eventSource = [[SREventSourceStreamReader alloc] initWithStream:operation.outputStream];
_eventSource.opened = ^() {
__strong __typeof(&*weakConnection)strongConnection = weakConnection;
SRLogSSEInfo(@"serverSentEvents did open eventSource");

// This will noop if we're not in the reconnecting state
if([strongConnection changeState:reconnecting toState:connected]) {
// Raise the reconnect event if the connection comes back up
[strongConnection didReconnect];
}
};
_eventSource.message = ^(SRServerSentEvent * sseEvent) {
__strong __typeof(&*weakSelf)strongSelf = weakSelf;
Expand Down

0 comments on commit 6550e5e

Please sign in to comment.