Permalink
Browse files

Expose didCloseWithCode in RCTReconnectingWebSocket

Summary: Expose didCloseWithCode in RCTReconnectingWebSocket in order to get notified when the reconnecting websocket is closed by the end-point.

Reviewed By: javache

Differential Revision: D5573394

fbshipit-source-id: 78bffeb98c6bf32b059194fc07ffc1f0a7bf4aae
  • Loading branch information...
cpluss authored and facebook-github-bot committed Aug 7, 2017
1 parent 220034c commit 72dae519d05ef4e9f0938d032e09409232836e01
@@ -17,6 +17,8 @@
- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message;
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;
@end
@interface RCTReconnectingWebSocket : NSObject
@@ -80,6 +80,7 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
{
[self.delegate webSocket:webSocket didCloseWithCode:code reason:reason wasClean:wasClean];
[self reconnect];
}
@@ -61,6 +61,10 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message
}
}
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
{
}
@end
#endif
@@ -133,6 +133,10 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message
}
}
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
{
}
@end
#endif

0 comments on commit 72dae51

Please sign in to comment.