mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Fix - ReconnectingWebSocket race condition mClosed"
Summary: Changelog:[Internal] Original commit changeset: 48793bd3bea9 Reviewed By: ShikaSD Differential Revision: D31170947 fbshipit-source-id: cb460e3261fdc2a0df6e3a4597c61bd879ecf38f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9cf4bb73c0
commit
4e8da9b28f
+6
-12
@@ -66,10 +66,8 @@ public final class ReconnectingWebSocket extends WebSocketListener {
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
synchronized (this) {
|
||||
if (mClosed) {
|
||||
throw new IllegalStateException("Can't connect closed client");
|
||||
}
|
||||
if (mClosed) {
|
||||
throw new IllegalStateException("Can't connect closed client");
|
||||
}
|
||||
|
||||
Request request = new Request.Builder().url(mUrl).build();
|
||||
@@ -84,10 +82,8 @@ public final class ReconnectingWebSocket extends WebSocketListener {
|
||||
}
|
||||
|
||||
private void reconnect() {
|
||||
synchronized (this) {
|
||||
if (mClosed) {
|
||||
throw new IllegalStateException("Can't reconnect closed client");
|
||||
}
|
||||
if (mClosed) {
|
||||
throw new IllegalStateException("Can't reconnect closed client");
|
||||
}
|
||||
|
||||
if (!mSuppressConnectionErrors) {
|
||||
@@ -106,10 +102,8 @@ public final class ReconnectingWebSocket extends WebSocketListener {
|
||||
}
|
||||
|
||||
public void closeQuietly() {
|
||||
synchronized (this) {
|
||||
mClosed = true;
|
||||
closeWebSocketQuietly();
|
||||
}
|
||||
mClosed = true;
|
||||
closeWebSocketQuietly();
|
||||
mMessageCallback = null;
|
||||
|
||||
if (mConnectionCallback != null) {
|
||||
|
||||
Reference in New Issue
Block a user