diff options
author | fcolin | 2007-02-01 10:01:44 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 10:01:44 +0000 |
commit | e2c951a22e785e64283e7192a92f052451c15cdb (patch) | |
tree | 7dfd959b7aacb660533eb170b056240d22f9da87 /CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs | |
parent | 5685dda17b86eece70486418a6f94544f3fc9311 (diff) | |
download | ivy-csharp-e2c951a22e785e64283e7192a92f052451c15cdb.zip ivy-csharp-e2c951a22e785e64283e7192a92f052451c15cdb.tar.gz ivy-csharp-e2c951a22e785e64283e7192a92f052451c15cdb.tar.bz2 ivy-csharp-e2c951a22e785e64283e7192a92f052451c15cdb.tar.xz |
Utilisateur : Fcolin Date : 22/12/05 Heure : 11:19 Archivé dans $/CSharp/Ivy Commentaire: bug format message (vss 2)
Diffstat (limited to 'CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs')
-rw-r--r-- | CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs b/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs index 12a204e..88e7041 100644 --- a/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs +++ b/CSharp/Ivy/IvyPPC/IvyTCPStreamV3.cs @@ -47,7 +47,7 @@ namespace IvyBus /*
* message Syntax:
- * this is a binary formated message use of network representation
+ * this is text formated message 'type id STX ARG0 {[ETX] ARG1 [ETX] ARGn}\n'
*
* message Format:
MessageType, id , length, string
@@ -57,27 +57,19 @@ namespace IvyBus output.Write(arg);
output.Write(sep);
}
- private void Serialize(string arg, char sep)
- {
- output.Write(arg);
- output.Write(sep);
- }
private void Serialize(string[] arg, char sep)
{
- /* serialize value */
- //Serialize(arg.Value);
-
- /* serialize children */
- //Serialize((short)arg.Count);
for (int i = 0; i < arg.Length; i++)
{
- Serialize(arg[i], sep);
+ output.Write(arg[i]);
+ if ( i != (arg.Length-1) ) output.Write(sep);
}
}
private void sendMsg(MessageType msgType, ushort msgId,params string[] msgData)
{
-
+#if DEBUG
Console.WriteLine(" sendMsg {0} id={1} data={2}", msgType, msgId, msgData);
+#endif
Serialize((ushort)msgType, ' ');
Serialize(msgId, ARG_START);
Serialize(msgData, ARG_END);
@@ -206,7 +198,9 @@ namespace IvyBus msgType = (MessageType)DeserializeShort();
msgId = DeserializeShort();
msgData = DeserializeArgument();
+#if DEBUG
Console.WriteLine(" receiveMsg {0} id={1} data={2}", msgType, msgId, msgData);
+#endif
switch (msgType)
{
case MessageType.Die:
|