mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-22 03:27:35 +08:00
Don't throw runtime exception if WebSocket is already closed
Summary: Refer #3364 Closes https://github.com/facebook/react-native/pull/3706 Reviewed By: svcscm Differential Revision: D2585455 Pulled By: mkonicek fb-gh-sync-id: fecd5e46c59a79a109aad97a49c9ea016e82d669
This commit is contained in:
committed by
facebook-github-bot-0
parent
b28ff0451d
commit
c45bb3e9c9
@@ -44,6 +44,7 @@ class WebSocketBase extends EventTarget {
|
||||
protocols = [];
|
||||
}
|
||||
|
||||
this.readyState = WebSocketBase.CONNECTING;
|
||||
this.connectToSocketImpl(url);
|
||||
}
|
||||
|
||||
@@ -57,6 +58,7 @@ class WebSocketBase extends EventTarget {
|
||||
this.cancelConnectionImpl();
|
||||
}
|
||||
|
||||
this.readyState = WebSocketBase.CLOSING;
|
||||
this.closeConnectionImpl();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user