Skip to content
This repository was archived by the owner on Nov 2, 2020. It is now read-only.

Commit 58f5de9

Browse files
committed
Fix of onDisconnected
1 parent 696579a commit 58f5de9

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies {
2323

2424
task sourcesJar(type: Jar, dependsOn: classes) {
2525
classifier = 'sources'
26-
from sourceSets.main.allSource
26+
from sourceSets.main.allJava
2727
}
2828

2929
task javadocJar(type: Jar, dependsOn: javadoc) {
Binary file not shown.
Binary file not shown.

src/main/java/META-INF/MANIFEST.MF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Manifest-Version: 1.0
2-
Main-Class: com.ClusterWS.ClusterWS
2+
Main-Class: C:\Users\Egor\IdeaProjects\ClusterWS-Client-Java-1.1.0 new
3+
company\ClusterWS-Client-Java\src\main\java
34

src/main/java/com/ClusterWS/ClusterWS.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class ClusterWS {
3535

3636
/**
3737
* test
38+
*
3839
* @param url
3940
* @param port
4041
*/
@@ -93,13 +94,16 @@ public void onDisconnected(WebSocket websocket, WebSocketFrame serverCloseFrame,
9394
if (serverCloseFrame == null) {
9495
serverCloseFrame = new WebSocketFrame().setCloseFramePayload(1006, "Unknown");
9596
}
97+
9698
if (clientCloseFrame == null) {
9799
clientCloseFrame = new WebSocketFrame().setCloseFramePayload(1006, "Unknown");
98100
}
101+
if (mReconnectionHandler.isInReconnectionState()) {
102+
return;
103+
}
104+
99105
if (mReconnectionHandler.isAutoReconnect() && serverCloseFrame.getCloseCode() != 1000 && clientCloseFrame.getCloseCode() != 1000) {
100-
if (!mReconnectionHandler.isInReconnectionState()) {
101-
mReconnectionHandler.reconnect(ClusterWS.this);
102-
}
106+
mReconnectionHandler.reconnect(ClusterWS.this);
103107
}
104108

105109
if (mClusterWSListener != null) {

0 commit comments

Comments
 (0)