summaryrefslogtreecommitdiff
path: root/CSharp/Ivy
diff options
context:
space:
mode:
Diffstat (limited to 'CSharp/Ivy')
-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: