View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

how to boot a server with a Routine

Home   How To   Code Pool   Public Library   Theory   Events


s = Server.local;
s.quit;

Routine({
	var limit = 100;
		if(s.serverRunning.not,{
			"not running".postln;
			if(s.boot.notNil,{ // it is trying
				while({
					"test".postln;
					s.serverRunning.not and: {(limit = limit - 1) > 0}
				},{
					"waiting for server to boot".postln;
					0.2.wait;	
				});
			});
			if(s.serverRunning.not,{
				"server failed to start".postln;
				thisThread.stop;
			},{
				"server started".postln;	
			});
		});
		s.serverRunning.postln;
}).play;



Link to this Page