Skip to content

Commit f5a39a7

Browse files
rylevmarci4
authored andcommitted
Do not decode frames when websocket is in "closing" state (TooTallNate#354)
added check if connection is not closing
1 parent ac27bda commit f5a39a7

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)