Headless Client shutdown

You can close the HC in the callback method of the calling client:

if(event.getType() == JSClient.CALLBACK_EXCEPTION_EVENT)
	{
		application.setStatusText(null)
		application.output(application.getServerTimeStamp()+" WARNING! totalizeCallback: Exception callback, name: " + event.data,LOGGINGLEVEL.ERROR);
		// Kill the HC
		_hc.shutdown(true)
		return;
	}
	
	if(event.getType() == JSClient.CALLBACK_EVENT)
	{
		var _log = event.data
                .....
		// Kill the HC
		_hc.shutdown(true)
         }