Skip to content

Commit 92c1382

Browse files
authored
Update SSLSocketChannel2.java
'handshakeStartTime' long variable is added and isHandShakeComplete() function is updated for TooTallNate#896. If wss handshake is not completed in 10s, close this channel to prevent cpu overload or unexpected channel error. See TooTallNate#896.
1 parent 4b5d78f commit 92c1382

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private boolean isHandShakeComplete() {
409409
// 2022-06-17 If wss handshake is not completed in 10s, close this channel to prevent cpu overload or unexpected channel error. see #896.
410410
if ( handshakeStartTime > 0 && ( System.currentTimeMillis() - handshakeStartTime ) > 10000 )
411411
{
412-
try{close() ;}catch(Exception ex){} ;
412+
try{close() ;}catch(IOException ex){} ;
413413
}
414414
}
415415

0 commit comments

Comments
 (0)