private void sendInstruction(String instruction)
                    throws IOException {

                // NOTE: Synchronization on the non-final remote field here is
                // intentional. The outbound websocket connection is only
                // sensitive to simultaneous attempts to send messages with
                // respect to itself. If the connection changes, then
                // synchronization need only be performed in context of the new
                // connection
                synchronized (connection) {
                    connection.sendMessage(instruction);
                }

            }
Sends a Guacamole instruction along the outbound WebSocket
connection to the connected Guacamole client. If an instruction
is already in the process of being sent by another thread, this
function will block until in-progress instructions are complete.

@param instruction
    The instruction to send.

@throws IOException
    If an I/O error occurs preventing the given instruction from
    being sent.
guacamole/src/main/java/org/apache/guacamole/tunnel/websocket/jetty8/GuacamoleWebSocketTunnelServlet.java