f2etest-guacamole/guacamole-client-0.9.3/guacamole-common/src/main/java/org/glyptodon/guacamole/protocol/ConfiguredGuacamoleSocket.java
/**
     * Waits for the instruction having the given opcode, returning that
     * instruction once it has been read. If the instruction is never read,
     * an exception is thrown.
     * 
     * @param reader The reader to read instructions from.
     * @param opcode The opcode of the instruction we are expecting.
     * @return The instruction having the given opcode.
     * @throws GuacamoleException If an error occurs while reading, or if
     *                            the expected instruction is not read.
     */
Waits for the instruction having the given opcode, returning that
instruction once it has been read. If the instruction is never read,
an exception is thrown.

@param reader The reader to read instructions from.
@param opcode The opcode of the instruction we are expecting.
@return The instruction having the given opcode.
@throws GuacamoleException If an error occurs while reading, or if
the expected instruction is not read.
Waits for the instruction having the given opcode returning that instruction once it has been read . If the instruction is never read an exception is thrown . @param reader The reader to read instructions from . @param opcode The opcode of the instruction we are expecting . @return The instruction having the given opcode . @throws GuacamoleException If an error occurs while reading or if the expected instruction is not read .
private GuacamoleInstruction expect(GuacamoleReader reader, String opcode)
        throws GuacamoleException {
        GuacamoleInstruction instruction = reader.readInstruction();
        if (instruction == null)
            throw new GuacamoleServerException("End of stream while waiting for \"" + opcode + "\".");
        if (!instruction.getOpcode().equals(opcode))
            throw new GuacamoleServerException("Expected \"" + opcode + "\" instruction but instead received \"" + instruction.getOpcode() + "\".");
        return instruction;
    }
private GuacamoleInstruction expect ( GuacamoleReader reader , String opcode ) throws GuacamoleException { GuacamoleInstruction instruction = reader . readInstruction ( ) ; if ( instruction == null ) throw new GuacamoleServerException ( "End of stream while waiting for \"" + opcode + "\"." ) ; if ( ! instruction . getOpcode ( ) . equals ( opcode ) ) throw new GuacamoleServerException ( "Expected \"" + opcode + "\" instruction but instead received \"" + instruction . getOpcode ( ) + "\"." ) ; return instruction ; }
Waits for the instruction having the given opcode, returning that
 instruction once it has been read.
Waits for the instruction having the given opcode returning that instruction once it has been read .
// Wait for an instruction // Ensure instruction has expected opcode