summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs
diff options
context:
space:
mode:
authorfcolin2007-02-01 10:02:34 +0000
committerfcolin2007-02-01 10:02:34 +0000
commitdeef6fba4325178e8056bcd33f4d5a7257d4be4f (patch)
tree221dfea852c92e48181d810294583d0e677ae5f5 /CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs
parentcf3f1d416b2b4f0a3e4ab1a2c62b46031e8255a3 (diff)
downloadivy-csharp-deef6fba4325178e8056bcd33f4d5a7257d4be4f.zip
ivy-csharp-deef6fba4325178e8056bcd33f4d5a7257d4be4f.tar.gz
ivy-csharp-deef6fba4325178e8056bcd33f4d5a7257d4be4f.tar.bz2
ivy-csharp-deef6fba4325178e8056bcd33f4d5a7257d4be4f.tar.xz
Utilisateur : Fcolin Date : 23/06/06 Heure : 11:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 11)
Diffstat (limited to 'CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs')
-rw-r--r--CSharp/Ivy/IvyPPC/IvyTCPStreamV4.cs28
1 files changed, 10 insertions, 18 deletions
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: