src/main/java/org/java_websocket/server/WebSocketServer.java
private void doAdditionalRead() throws InterruptedException, IOException {
		WebSocketImpl conn;
		while ( !iqueue.isEmpty() ) {
			conn = iqueue.remove( 0 );
			WrappedByteChannel c = ( (WrappedByteChannel) conn.getChannel() );
			ByteBuffer buf = takeBuffer();
			try {
				if( SocketChannelIOHelper.readMore( buf, conn, c ) )
					iqueue.add( conn );
				if( buf.hasRemaining() ) {
					conn.inQueue.put( buf );
					queue( conn );
				} else {
					pushBuffer( buf );
				}
			} catch ( IOException e ) {
				pushBuffer( buf );
				throw e;
			}
		}
	}
private void doAdditionalRead() throws InterruptedException, IOException {
		WebSocketImpl conn;
		while ( !iqueue.isEmpty() ) {
			conn = iqueue.remove( 0 );
			WrappedByteChannel c = ( (WrappedByteChannel) conn.getChannel() );
			ByteBuffer buf = takeBuffer();
			try {
				if( SocketChannelIOHelper.readMore( buf, conn, c ) )
					iqueue.add( conn );
				if( buf.hasRemaining() ) {
					conn.inQueue.put( buf );
					queue( conn );
				} else {
					pushBuffer( buf );
				}
			} catch ( IOException e ) {
				pushBuffer( buf );
				throw e;
			}
		}
	}
private void doAdditionalRead ( ) throws InterruptedException , IOException { WebSocketImpl conn ; while ( ! iqueue . isEmpty ( ) ) { conn = iqueue . remove ( 0 ) ; WrappedByteChannel c = ( ( WrappedByteChannel ) conn . getChannel ( ) ) ; ByteBuffer buf = takeBuffer ( ) ; try { if ( SocketChannelIOHelper . readMore ( buf , conn , c ) ) iqueue . add ( conn ) ; if ( buf . hasRemaining ( ) ) { conn . inQueue . put ( buf ) ; queue ( conn ) ; } else { pushBuffer ( buf ) ; } } catch ( IOException e ) { pushBuffer ( buf ) ; throw e ; } } }
Do an additional read
@throws InterruptedException thrown by taking a buffer
@throws IOException if an error happened during read
Do an additional read