Skip to content

Commit 0d90fc9

Browse files
committed
Deprecate CONNECTING
1 parent 46b260e commit 0d90fc9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main/java/org/java_websocket/WebSocket.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ enum Role {
4646
* Enum which represents the state a websocket may be in
4747
*/
4848
enum READYSTATE {
49-
NOT_YET_CONNECTED, CONNECTING, OPEN, CLOSING, CLOSED
49+
NOT_YET_CONNECTED,
50+
@Deprecated
51+
CONNECTING, OPEN, CLOSING, CLOSED
5052
}
5153

5254
/**
@@ -172,6 +174,7 @@ enum READYSTATE {
172174
* Is the websocket in the state CONNECTING
173175
* @return state equals READYSTATE.CONNECTING
174176
*/
177+
@Deprecated
175178
boolean isConnecting();
176179

177180
/**

src/main/java/org/java_websocket/WebSocketImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ public boolean hasBufferedData() {
647647
}
648648

649649
public void startHandshake( ClientHandshakeBuilder handshakedata ) throws InvalidHandshakeException {
650-
assert ( getReadyState() != READYSTATE.CONNECTING ) : "shall only be called once";
651-
652650
// Store the Handshake Request we are about to send
653651
this.handshakerequest = draft.postProcessHandshakeRequestAsClient( handshakedata );
654652

@@ -710,6 +708,7 @@ private void open( Handshakedata d ) {
710708
}
711709

712710
@Override
711+
@Deprecated
713712
public boolean isConnecting() {
714713
assert ( !flushandclosestate || getReadyState() == READYSTATE.CONNECTING );
715714
return getReadyState() == READYSTATE.CONNECTING; // ifflushandclosestate

src/main/java/org/java_websocket/client/WebSocketClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ public boolean isClosing() {
707707
}
708708

709709
@Override
710+
@Deprecated
710711
public boolean isConnecting() {
711712
return engine.isConnecting();
712713
}

0 commit comments

Comments
 (0)