diff options
Diffstat (limited to 'CSharp/Ivy/IvyPerf')
-rw-r--r-- | CSharp/Ivy/IvyPerf/IvyPerf.cs | 9 |
1 files 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);
|