From 63a06beae3f8e5495c6d374c8bdcd92d9095453e Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 10:04:34 +0000 Subject: Utilisateur : Fcolin Date : 13/01/06 Heure : 16:30 Archivé dans $/CSharp/Ivy/IvyPerf Commentaire: (vss 3) --- CSharp/Ivy/IvyPerf/IvyPerf.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CSharp/Ivy/IvyPerf/IvyPerf.cs b/CSharp/Ivy/IvyPerf/IvyPerf.cs index 82fd010..a25e58a 100644 --- a/CSharp/Ivy/IvyPerf/IvyPerf.cs +++ b/CSharp/Ivy/IvyPerf/IvyPerf.cs @@ -21,10 +21,12 @@ namespace IvyPerf //time = Environment.TickCount; return time; } + [IvyBinding("^ping ts=(.*)")] static void Reply(IvyClient client, string[] args) { - bus.sendMsg(c,"pong ts={0} tr={1}", args, currentTime()); + bus.sendMsg(c,"pong ts={0} tr={1}", args[0], currentTime()); } + [IvyBinding("^pong ts=(.*) tr=(.*)")] static void Pong(IvyClient client, string[] args) { double current = currentTime(); @@ -42,8 +44,9 @@ namespace IvyPerf { c = new CultureInfo("en-us"); bus = new Ivy("IvyPerf", "IvyPref ready"); - bus.bindMsg( "^ping ts=(.*)", new Ivy.MessageHandler( Reply ) ); - bus.bindMsg( "^pong ts=(.*) tr=(.*)", new Ivy.MessageHandler( Pong ) ); + bus.AutoBinding(typeof(IvyPerf)); + //bus.bindMsg( "^ping ts=(.*)", new Ivy.MessageHandler( Reply ) ); + //bus.bindMsg( "^pong ts=(.*) tr=(.*)", new Ivy.MessageHandler( Pong ) ); //bus.bindSimpleMsg( "ping:ts", new Ivy.MessageHandler( Reply ) ); //bus.bindSimpleMsg( "pong:ts,tr", new Ivy.MessageHandler( Pong ) ); bus.start(null); -- cgit v1.1