summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs
diff options
context:
space:
mode:
authorfcolin2007-02-01 11:59:19 +0000
committerfcolin2007-02-01 11:59:19 +0000
commit31a4ba441a313dca7821cae97378ac77b90068cc (patch)
tree0a1ce34e3217d3810cff6d86c8d7e215b783975c /CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs
parentcbf21e890ed2df9dc964bd017b48da8e94e2c608 (diff)
downloadivy-csharp-31a4ba441a313dca7821cae97378ac77b90068cc.zip
ivy-csharp-31a4ba441a313dca7821cae97378ac77b90068cc.tar.gz
ivy-csharp-31a4ba441a313dca7821cae97378ac77b90068cc.tar.bz2
ivy-csharp-31a4ba441a313dca7821cae97378ac77b90068cc.tar.xz
suppression niveaux
Diffstat (limited to 'CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs')
-rw-r--r--CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs80
1 files changed, 0 insertions, 80 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs b/CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs
deleted file mode 100644
index b8d329a..0000000
--- a/CSharp/Ivy/IvyPPC/IvyUDPStreamV4.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Net;
-using System.Net.Sockets;
-using System.IO;
-
-namespace IvyBus
-{
- class IvyUDPStreamV4 : IvyUDPStream
- {
-
- BinaryReader input;
- BinaryWriter output;
-
- /// the protocol version number
- internal const ushort PROCOCOLVERSION = 4;
- public IvyUDPStreamV4(Socket _socket) : base ( _socket, PROCOCOLVERSION)
- {
- input = new BinaryReader( in_stream,Encoding.ASCII);
- output = new BinaryWriter(out_stream, Encoding.ASCII);
- }
- /*
- * message Syntax:
- * this is a binary formated message use of network representation
- *
- * message Format:
- protocol_version, TCP server port , lenAppId, appId, lenAppNameId, appName
- */
- private ushort DeserializeShort()
- {
- return (ushort)IPAddress.NetworkToHostOrder((ushort)input.ReadUInt16());
- }
- private string DeserializeString()
- {
- string arg;
- int val_len;
- char[] data;
- val_len = (ushort)IPAddress.NetworkToHostOrder((ushort)input.ReadUInt16());
- if (val_len != 0)
- {
- data = input.ReadChars(val_len);
- arg = new String(data);
- }
- else
- arg = "";
- return arg;
- }
-
- internal override void Deserialize(out ushort version, out ushort port, out string appId, out string appName)
- {
- version = DeserializeShort();
- port = DeserializeShort();
- appId = DeserializeString();
- appName = DeserializeString();
-
- }
- private void Serialize(ushort arg)
- {
- output.Write((ushort)IPAddress.HostToNetworkOrder(arg));
- }
- private void Serialize(string arg)
- {
- ushort length = arg != null ? (ushort)arg.Length : (ushort)0;
- Serialize(length);
- if (length != 0)
- output.Write(arg.ToCharArray());
- }
-
- internal override void Serialize(ushort port, string appId, string appName)
- {
- Serialize(PROCOCOLVERSION );
- Serialize(port);
- Serialize(appId);
- Serialize(appName);
- output.Flush();
- }
-
- }
-}