Skip to content

Commit cd25949

Browse files
committed
Do not decode frames when websocket is in "closing" state
1 parent 58d1778 commit cd25949

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public void run() {
181181
int readBytes;
182182

183183
try {
184-
while ( !isClosed() && ( readBytes = istream.read( rawbuffer ) ) != -1 ) {
184+
while ( !isClosing() && !isClosed() && ( readBytes = istream.read( rawbuffer ) ) != -1 ) {
185185
engine.decode( ByteBuffer.wrap( rawbuffer, 0, readBytes ) );
186186
}
187187
engine.eot();

0 commit comments

Comments
 (0)