Expose webSocketDidOpen in RCTReconnectingWebSocket
Summary: Expose webSocketDidOpen in RCTReconnectingWebSocket in order to get notified when the reconnecting websocket is opened to the endpoint. Reviewed By: emilsjolander Differential Revision: D5725547 fbshipit-source-id: e904c5a84d670ecf936993ec1739614f99fce09c
This commit is contained in:
parent
b11656a727
commit
bf67345b3b
|
@ -15,6 +15,8 @@
|
|||
|
||||
@protocol RCTWebSocketProtocolDelegate
|
||||
|
||||
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket;
|
||||
|
||||
- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message;
|
||||
|
||||
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;
|
||||
|
|
|
@ -101,6 +101,11 @@ static void my_nwlog_legacy_v(int level, char *format, va_list args) {
|
|||
});
|
||||
}
|
||||
|
||||
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
|
||||
{
|
||||
[self.delegate webSocketDidOpen:webSocket];
|
||||
}
|
||||
|
||||
- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error
|
||||
{
|
||||
[self reconnect];
|
||||
|
|
|
@ -66,6 +66,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
|
||||
{
|
||||
}
|
||||
|
||||
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
|
||||
{
|
||||
}
|
||||
|
|
|
@ -132,6 +132,10 @@ static BOOL isSupportedVersion(NSNumber *version)
|
|||
}
|
||||
}
|
||||
|
||||
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
|
||||
{
|
||||
}
|
||||
|
||||
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue