Skip to content

Commit 3e39cb6

Browse files
committed
made SSLSocketChannel2.java not suppress EOT
1 parent 86b3c05 commit 3e39cb6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/org/java_websocket/SSLSocketChannel2.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ private void processHandshake() throws IOException {
8282

8383
if( res.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_UNWRAP ) {
8484
inCrypt.compact();
85-
sc.read( inCrypt );
85+
int read = sc.read( inCrypt );
86+
if( read == -1 ) {
87+
throw new IOException( "connection closed unexpectedly by peer" );
88+
}
8689
inCrypt.flip();
8790
inData.compact();
8891
unwrap();

0 commit comments

Comments
 (0)