# HG changeset patch # User riono # Date 1605609284 -32400 # Node ID 5f726dc31874c78c494668d5d1d3c4e90ef7fccb # Parent ce6906edcbf45d715c84b4b399785e83f2dcbaa7 add Connection class diff -r ce6906edcbf4 -r 5f726dc31874 daemon/Connection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/daemon/Connection.cs Tue Nov 17 19:34:44 2020 +0900 @@ -0,0 +1,43 @@ +using System; +using System.Collections.Concurrent; +using System.IO; +using System.Net.Sockets; +using Christie_net.datagear.command; + +namespace Christie_net.daemon { +public class Connection { + public Socket socket; + public string name; + public CodeGearManager cgm; + public ConcurrentQueue sendQueue = new ConcurrentQueue(); + public bool sendManager = true; + private object syncObject = new object(); + + public Connection(Socket socket, CodeGearManager cgm) { + this.socket = socket; + this.cgm = cgm; + } + + public Connection(){} + + public void SendCommand(Command cmd) { + sendQueue.Enqueue(cmd); + } + + public string GetInfoString() { + return socket. + } + + public void Close() { + socket + } + + public void Write(Command cmd) { + MemoryStream stream = cmd.Convert(); + + while (stream.) { + + } + } +} +} \ No newline at end of file diff -r ce6906edcbf4 -r 5f726dc31874 datagear/command/CommandType.cs --- a/datagear/command/CommandType.cs Tue Nov 17 18:46:22 2020 +0900 +++ b/datagear/command/CommandType.cs Tue Nov 17 19:34:44 2020 +0900 @@ -13,6 +13,7 @@ FINISH } +// C#ではenumに関数は生やせないためヘルパークラスを実装 public class CommandTypeEtx { public CommandType commandType; public int id; // command ID