Mercurial > hg > Database > Christie-sharp
view datagear/command/RemoteTakeCommand.cs @ 51:486683ead53f
bug survey
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 11 Jan 2022 20:02:18 +0900 |
parents | 9217d14cc220 |
children | e75e143b92e7 |
line wrap: on
line source
using System; using System.IO; using Christie_net.datagear.dg; using MessagePack; namespace Christie_net.datagear.command { public class RemoteTakeCommand : Command{ public RemoteTakeCommand(CommandBuilder cb) : base(cb) { this.dg = new MessagePackDataGear<object>(this.clazz); } public override void Execute() { new CommandBuilder().Init(CommandType.REPLY).Connection(connection).Key(key).Dg(dg).Build().Execute(); } public override byte[] Convert() { MemoryStream stream = new MemoryStream(); try { byte[] command = MessagePackSerializer.Serialize(CreateRemoteMessage(null)); stream.Write(command); stream.Position = 0; } catch (IOException e) { Console.WriteLine(e.StackTrace); } return stream.ToArray(); } } }