Example #1
0
        private static void PutDirect()
        {
            var systemL = AllPet.Pipeline.PipelineSystem.CreatePipelineSystemV1(new AllPet.Common.Logger());

            systemL.OpenNetwork(new AllPet.peer.tcp.PeerOption());
            var remote    = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 8888);
            var systemref = systemL.ConnectAsync(remote).Result;

            systemL.Start();
            var actor = systemL.GetPipeline(null, "127.0.0.1:8888/simpledb");

            {
                PutDirectCommand command = new PutDirectCommand()
                {
                    TableId = new byte[] { 0x03, 0x02, 0x03 },
                    Key     = new byte[] { 0x10, 0x10 },
                    Data    = new byte[] { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
                };
                var bytes = ProtocolFormatter.Serialize <PutDirectCommand>(Method.PutDirect, command);
                actor.Tell(bytes);
            }
            systemL.CloseListen();
            systemL.CloseNetwork();
            systemL.Dispose();
        }
Example #2
0
 public void Handle(PutDirectCommand command)
 {
     Console.WriteLine("PutDirectCommand");
     this.SimpleDb.PutDirect(command.TableId, command.Key, command.Data);
 }