From e6855cc883c7a05848e74cb2afed197a4203141f Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 10:01:50 +0000 Subject: Utilisateur : Fcolin Date : 12/01/06 Heure : 9:46 Archivé dans $/CSharp/Ivy Commentaire: (vss 5) --- CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'CSharp/Ivy/IvyPPC') 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: -- cgit v1.1