code: function close_tunnel(status) {
  
          // Ignore if already closed
          if (tunnel.state === Guacamole.Tunnel.State.CLOSED)
              return;
  
          // If connection closed abnormally, signal error.
          if (status.code !== Guacamole.Status.Code.SUCCESS && tunnel.onerror) {
  
              // Ignore RESOURCE_NOT_FOUND if we've already connected, as that
              // only signals end-of-stream for the HTTP tunnel.
              if (tunnel.state === Guacamole.Tunnel.State.CONNECTING
                      || status.code !== Guacamole.Status.Code.RESOURCE_NOT_FOUND)
                  tunnel.onerror(status);
  
          }
  
          // Reset output message buffer
          sendingMessages = false;
  
          // Mark as closed
          tunnel.setState(Guacamole.Tunnel.State.CLOSED);
  
      }
docs: Closes this tunnel, signaling the given status and corresponding
  message, which will be sent to the onerror handler if the status is
  an error status.
  
  @private
  @param {Guacamole.Status} status The status causing the connection to
  close;