Permalink
Browse files

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
  • Loading branch information...
cpluss authored and facebook-github-bot committed Aug 29, 2017
1 parent b11656a commit bf67345b3bd30de5917c27be1ff2b3ba9f7f11b0
@@ -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 @@ - (void)reconnect
});
}
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
{
[self.delegate webSocketDidOpen:webSocket];
}
- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error
{
[self reconnect];
@@ -66,6 +66,10 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message
}
}
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
{
}
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
{
}
@@ -132,6 +132,10 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message
}
}
- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket
{
}
- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean
{
}

0 comments on commit bf67345

Please sign in to comment.