From deef6fba4325178e8056bcd33f4d5a7257d4be4f Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 10:02:34 +0000 Subject: Utilisateur : Fcolin Date : 23/06/06 Heure : 11:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 11) --- CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'CSharp') diff --git a/CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs b/CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs index 028b2c5..9a96d62 100644 --- a/CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs +++ b/CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs @@ -96,15 +96,16 @@ namespace IvyBus sendMsg(MessageType.ApplicationId, priority, appId); } - void IvyProtocol.TokenAddBinding(Ivy.ApplicationBinding bind) + void IvyProtocol.TokenAddBinding(BindingType type, ushort id, string expression) { - if (bind.type == Ivy.BindingType.BindRegexp) + switch (type) { - sendMsg(MessageType.AddRegexp, bind.key, bind.expression); /* perhaps we should perform some checking here */ - } - else - { - sendMsg(MessageType.AddBinding, bind.key, bind.expression); /* perhaps we should perform some checking here */ + case BindingType.Regexp: + sendMsg(MessageType.AddRegexp, id, expression); /* perhaps we should perform some checking here */ + break; + case BindingType.Simple: + sendMsg(MessageType.AddBinding, id, expression); /* perhaps we should perform some checking here */ + break; } } @@ -185,7 +186,6 @@ namespace IvyBus } bool IvyProtocol.receiveMsg() { - Ivy.ApplicationBinding bind; MessageType msgType = MessageType.Die; ushort msgId = 0; string[] msgData = null; @@ -207,19 +207,11 @@ namespace IvyBus break; case MessageType.AddRegexp: - bind = new Ivy.ApplicationBinding(); - bind.type = Ivy.BindingType.BindRegexp; - bind.key = msgId; - bind.expression = msgData[0]; - receiver.TokenAddBinding(bind); + receiver.TokenAddBinding(BindingType.Regexp, msgId, msgData[0]); break; case MessageType.AddBinding: - bind = new Ivy.ApplicationBinding(); - bind.type = Ivy.BindingType.BindSimple; - bind.key = msgId; - bind.expression = msgData[0]; - receiver.TokenAddBinding(bind); + receiver.TokenAddBinding(BindingType.Simple, msgId, msgData[0]); break; case MessageType.DelBinding: -- cgit v1.1