Wait 1s before reconnect websocket.
This commit is contained in:
parent
544abd218c
commit
cafb220768
@ -106,6 +106,11 @@ public abstract class AbstractClientWS implements AbstractWS {
|
|||||||
private void reconnectIfNecessary() {
|
private void reconnectIfNecessary() {
|
||||||
synchronized (socket) {
|
synchronized (socket) {
|
||||||
if (autoReconnect && !isConnecting && socket.get() == null) {
|
if (autoReconnect && !isConnecting && socket.get() == null) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
connect();
|
connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user