summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs
diff options
context:
space:
mode:
Diffstat (limited to 'CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs')
-rw-r--r--CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs20
1 files changed, 11 insertions, 9 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs b/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs
index a5431c4..229e37d 100644
--- a/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs
+++ b/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs
@@ -15,14 +15,14 @@ namespace IvyBus
{
StreamReader input;
StreamWriter output;
- IvyProtocolInterface receiver;
+ IvyProtocol receiver;
/// the protocol separator
internal const char ARG_START = '\x02';
internal const char ARG_END = '\x03';
internal const char MSG_END = '\n';
- internal IvyTCPStreamV3(Socket socket, IvyProtocolInterface _receiver) : base ( socket )
+ internal IvyTCPStreamV3(Socket socket, IvyProtocol _receiver) : base ( socket )
{
output = new StreamWriter(stream, Encoding.ASCII);
output.NewLine = MSG_END.ToString();
@@ -80,13 +80,11 @@ namespace IvyBus
// NOt implemented in this protocol version
}
- internal override void TokenAddRegexp(ushort id, string bind)
+ internal override void TokenAddBinding(Ivy.ApplicationBinding bind)
{
- sendMsg(MessageType.AddRegexp, id, bind); /* perhaps we should perform some checking here */
- }
- internal override void TokenAddBinding(ushort id, string bind)
- {
- // NOt implemented in this protocol version
+ // NO Simple Binding in this protocol
+ if ( bind.type == Ivy.BindingType.BindRegexp )
+ sendMsg(MessageType.AddRegexp, bind.key, bind.expression); /* perhaps we should perform some checking here */
}
internal override void TokenDelBinding(ushort id)
@@ -163,6 +161,7 @@ namespace IvyBus
internal override bool receiveMsg()
{
+ Ivy.ApplicationBinding bind = new Ivy.ApplicationBinding();
MessageType msgType = MessageType.Die;
ushort msgId = 0;
string msgData = null;
@@ -186,7 +185,10 @@ namespace IvyBus
break;
case MessageType.AddRegexp:
- receiver.TokenAddRegexp(msgId, msgData);
+ bind.type = Ivy.BindingType.BindRegexp;
+ bind.key = msgId;
+ bind.expression = msgData;
+ receiver.TokenAddBinding(bind);
break;
case MessageType.DelBinding: