Skip to content

Commit cadb9c1

Browse files
committed
If connection closed isNeedRead() always returns true. We need to
check the status of SSLResult for it.
1 parent 5d4dead commit cadb9c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/java_websocket/SSLSocketChannel2.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ public void writeMore() throws IOException {
313313

314314
@Override
315315
public boolean isNeedRead() {
316-
return inData.hasRemaining() || ( inCrypt.hasRemaining() && engineResult.getStatus() != Status.BUFFER_UNDERFLOW );
316+
return inData.hasRemaining() || ( inCrypt.hasRemaining() && engineResult.getStatus() != Status.BUFFER_UNDERFLOW &&
317+
engineResult.getStatus() != Status.CLOSED );
317318
}
318319

319320
@Override

0 commit comments

Comments
 (0)