Mercurial > hg > Database > Christie-sharp
changeset 42:ce46626dddb1
RemoteDG string send test
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 19 Sep 2021 17:04:08 +0900 |
parents | 0cd765be9693 |
children | 87d88bc28ac0 |
files | Test/Example/HelloWorld/HelloWorldCodeGear.cs Test/Example/HelloWorld/StartHelloWorld.cs Test/Example/RemoteTake/CreateRemoteTakeTest.cs Test/Example/RemoteTake/StartRemoteTake.cs daemon/Connection.cs daemon/IncomingTcpConnection.cs datagear/LocalDataGearManager.cs datagear/RemoteDataGearManager.cs datagear/command/PutCommand.cs datagear/dg/DataGear.cs datagear/dg/MessagePackDataGear.cs |
diffstat | 11 files changed, 16 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/Test/Example/HelloWorld/HelloWorldCodeGear.cs Tue May 25 17:31:17 2021 +0900 +++ b/Test/Example/HelloWorld/HelloWorldCodeGear.cs Sun Sep 19 17:04:08 2021 +0900 @@ -1,13 +1,14 @@ using System; using Christie_net.annotation; using Christie_net.codegear; +using Christie_net.Test.Example.RemoteTake; namespace Christie_net.Test.Example.HelloWorld { public class HelloWorldCodeGear : CodeGear { - [Take] string helloWorld; + [Take] public string helloWorld; public override void Run(CodeGearManager cgm) { - Console.Write(helloWorld + " "); + Console.Write(helloWorld + " " ); cgm.Setup(new HelloWorldCodeGear()); cgm.GetLocalDGM().Put(helloWorld, helloWorld); }
--- a/Test/Example/HelloWorld/StartHelloWorld.cs Tue May 25 17:31:17 2021 +0900 +++ b/Test/Example/HelloWorld/StartHelloWorld.cs Sun Sep 19 17:04:08 2021 +0900 @@ -1,6 +1,7 @@ using System; using System.Threading; using Christie_net.codegear; +using Christie_net.Test.Example.RemoteTake; namespace Christie_net.Test.Example.HelloWorld { public class StartHelloWorld : StartCodeGear {
--- a/Test/Example/RemoteTake/CreateRemoteTakeTest.cs Tue May 25 17:31:17 2021 +0900 +++ b/Test/Example/RemoteTake/CreateRemoteTakeTest.cs Sun Sep 19 17:04:08 2021 +0900 @@ -4,7 +4,7 @@ namespace Christie_net.Test.Example.RemoteTake { public class CreateRemoteTakeTest : CodeGear { - [Take] public RTCommand command; + [Take] public string command; public override void Run(CodeGearManager cgm) {
--- a/Test/Example/RemoteTake/StartRemoteTake.cs Tue May 25 17:31:17 2021 +0900 +++ b/Test/Example/RemoteTake/StartRemoteTake.cs Sun Sep 19 17:04:08 2021 +0900 @@ -10,7 +10,8 @@ cgm.Setup(new CreateRemoteTakeTest()); cgm.Setup(new FinishRemoteTake()); RTCommand cmd = new RTCommand("insert", "line", 0); - cgm.GetDGM("remote").Put("command", cmd); + + cgm.GetDGM("remote").Put("command", "test"); } }
--- a/daemon/Connection.cs Tue May 25 17:31:17 2021 +0900 +++ b/daemon/Connection.cs Sun Sep 19 17:04:08 2021 +0900 @@ -53,7 +53,7 @@ /// <param name="cmd"></param> public void Write(Command cmd) { // Debug - //Console.WriteLine("length:" + cmd.type); + Console.WriteLine("length:" + cmd.dg.GetData()); byte[] buffer = cmd.Convert();
--- a/daemon/IncomingTcpConnection.cs Tue May 25 17:31:17 2021 +0900 +++ b/daemon/IncomingTcpConnection.cs Sun Sep 19 17:04:08 2021 +0900 @@ -70,7 +70,7 @@ // Type t = Type.GetType(msg.clazz); // object obj = MessagePackSerializer.Deserialize<object>(msg.data); // RTCommand cmd = (RTCommand) obj; - Console.WriteLine("***type:" + msg.type + " key:" + msg.key + " fromDgm:" + msg.fromDmgName + " class:" + msg.clazz); + //Console.WriteLine("***type:" + msg.type + " key:" + msg.key + " fromDgm:" + msg.fromDmgName + " class:" + msg.clazz); // Console.WriteLine("data :" + cmd.line); cgm.GetLocalDGM().Put(msg.key, dg);
--- a/datagear/LocalDataGearManager.cs Tue May 25 17:31:17 2021 +0900 +++ b/datagear/LocalDataGearManager.cs Sun Sep 19 17:04:08 2021 +0900 @@ -1,6 +1,7 @@ using System; using Christie_net.datagear.command; using Christie_net.datagear.dg; +using Christie_net.Test.Example.RemoteTake; namespace Christie_net.datagear { public class LocalDataGearManager : DataGearManager {
--- a/datagear/RemoteDataGearManager.cs Tue May 25 17:31:17 2021 +0900 +++ b/datagear/RemoteDataGearManager.cs Sun Sep 19 17:04:08 2021 +0900 @@ -72,7 +72,8 @@ } // Debug - //Console.WriteLine("coneect:" + connection); + Console.WriteLine("connect:" + connection); + Console.WriteLine("data:" + data); connection.Write(cm); }
--- a/datagear/command/PutCommand.cs Tue May 25 17:31:17 2021 +0900 +++ b/datagear/command/PutCommand.cs Sun Sep 19 17:04:08 2021 +0900 @@ -26,9 +26,9 @@ // stream.Write(dataSize); // stream.Write(data); - var dgData = dg.GetData(); + //var dgData = dg.GetData(); - byte[] data = new MessagePackDataGear<RTCommand>(dg.GetData() as RTCommand).GetMessagePack(); + byte[] data = new MessagePackDataGear<object>(dg.GetData()).GetMessagePack(); byte[] command = MessagePackSerializer.Serialize(CreateRemoteMessage(data)); // Debug
--- a/datagear/dg/DataGear.cs Tue May 25 17:31:17 2021 +0900 +++ b/datagear/dg/DataGear.cs Sun Sep 19 17:04:08 2021 +0900 @@ -9,7 +9,7 @@ SetClazz(data.GetType()); SetData(data); - Console.WriteLine("type:" + data.GetType()); + //Console.WriteLine("type:" + data.GetType()); } public DataGear(Type clazz) {
--- a/datagear/dg/MessagePackDataGear.cs Tue May 25 17:31:17 2021 +0900 +++ b/datagear/dg/MessagePackDataGear.cs Sun Sep 19 17:04:08 2021 +0900 @@ -15,7 +15,7 @@ public MessagePackDataGear(Type clazz) : base(clazz) { } public MessagePackDataGear(byte[] messagePack, Type clazz) : base(clazz) { - Console.WriteLine("call"); + //Console.WriteLine("call"); this.messagePack = messagePack; }