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)
              tunnel.onerror(status);
  
          // Mark as closed
          tunnel.setState(Guacamole.Tunnel.State.CLOSED);
  
          socket.close();
  
      }
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;