Skip to content

Commit

Permalink
Ignore SRStatusCodeNormal when closing the socket
Browse files Browse the repository at this point in the history
Fixes pusher#196 - Explicit Disconnect causes reconnect
(Following changes in SocketRocket facebookincubator/SocketRocket@818cec9)
  • Loading branch information
jilouc committed May 24, 2016
1 parent a7c4425 commit 9d42213
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Library/PTPusherConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reas
self.socketID = nil;
socket = nil;

if (code == SRStatusCodeNormal) {
code = 0;
}

// we always call this last, to prevent a race condition if the delegate calls 'connect'
[self.delegate pusherConnection:self didDisconnectWithCode:(NSInteger)code reason:(NSString *)reason wasClean:wasClean];
}
Expand Down

0 comments on commit 9d42213

Please sign in to comment.