summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfcolin2007-02-01 10:01:50 +0000
committerfcolin2007-02-01 10:01:50 +0000
commite6855cc883c7a05848e74cb2afed197a4203141f (patch)
treeadc26d3fb6dc4d6ad4a807badc657d330f205ba5
parent99c5ffe3d0e5900006efc300a2196f296311d7e0 (diff)
downloadivy-csharp-e6855cc883c7a05848e74cb2afed197a4203141f.zip
ivy-csharp-e6855cc883c7a05848e74cb2afed197a4203141f.tar.gz
ivy-csharp-e6855cc883c7a05848e74cb2afed197a4203141f.tar.bz2
ivy-csharp-e6855cc883c7a05848e74cb2afed197a4203141f.tar.xz
Utilisateur : Fcolin Date : 12/01/06 Heure : 9:46 Archivé dans $/CSharp/Ivy Commentaire: (vss 5)
-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: