Skip to content

Commit c5e3c81

Browse files
committed
fixed problem with thread interrupt (TooTallNate#119)
1 parent a53705d commit c5e3c81

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/org/java_websocket/WebSocketImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,15 @@ public void startHandshake( ClientHandshakeBuilder handshakedata ) throws Invali
542542
private void write( ByteBuffer buf ) {
543543
if( DEBUG )
544544
System.out.println( "write(" + buf.remaining() + "): {" + ( buf.remaining() > 1000 ? "too big to display" : new String( buf.array() ) ) + "}" );
545-
try {
545+
546+
outQueue.add( buf );
547+
/*try {
546548
outQueue.put( buf );
547549
} catch ( InterruptedException e ) {
550+
write( buf );
551+
Thread.currentThread().interrupt(); // keep the interrupted status
548552
e.printStackTrace();
549-
}
553+
}*/
550554
wsl.onWriteDemand( this );
551555
}
552556

0 commit comments

Comments
 (0)