%
% anyremote configuration file for anyRemote performancs testing. (Server-mode)
%

% STATUS unknown
% XTEST no
% SOUND no
% ENV no

GuiAppName=parser test
GuiAppType=Example
GuiAppBinary=true
GuiAppProtocols=Server
GuiAppDesc=Test of anyRemote performance.

[Protocol]=Server

(Init)=\
	Exec(echo Inited);
	
	
(Connect)=\
 	Set(parameter,debug,on);\
	Exec(echo Connected);\
	Set(status,0);\
	Set(title,choose number of pings);\
	Set(icons,List Example,\
		1,fit,2,fit,3,fit,\
		4,default,5,default,6,default,\
		7,default,8,default,9,default,\
		*,question,0,no,#,default);
		
(Disconnect)=\
	Exec(echo Disconnected)

(InCall)=\
	Exec(echo "Incoming call")

(EndCall)=\
	Exec(echo "Call ends")

(Exit)=\
	Exec(echo "hello from exit handler")

* *=Set(text,replace,Help,Choose number of pings\n1 - 10\n2 - 100\n3 - 1000);

Back=Set(text,close);

0=Exit;

1=Make(var,ping_number,by_value,10);\
	Macro(STARTPING);

2=Make(var,ping_number,by_value,100);\
	Macro(STARTPING);

3=Make(var,ping_number,by_value,1000);\
	Macro(STARTPING);

STARTPING=\
	Make(var,ping_done,by_value,0);\
	Make(var,starttime,date "+%s");\
	Set(status,0);\
	Exec(echo "start $(starttime)");\
	Macro(ONE_MORE);
	
Ping=\
	Make(var,ping_done,expr $(ping_done) + 1);\
	Exec(echo "ping $(ping_done) "`date "+%s"`);\
	Set(status,$(ping_done));\
	Make(var,is_done,if [ "x$(ping_done)" = "x$(ping_number)" ]; then echo DONE; else echo ONE_MORE; fi);\
	Macro($(is_done));

ONE_MORE=\
	Get(ping);

DONE=\
	Make(var,endtime,date "+%s");\
	Make(var,elapsed,expr $(endtime) - $(starttime));\
	Exec(echo "end $(endtime)");\
	Exec(echo "elapsed $(elapsed)");

[End]
