Ejemplo n.º 1
0
        void ProcessMessageList()
        {
            var req = RequestMessageList.Deserialize(ProtocolParser.ReadBytes(input));
            ReplyMessageList reply = new ReplyMessageList();
            List <ChunkHash> list  = localRepo.GetMessageList(req.Prefix);

            foreach (ChunkHash ch in list)
            {
                reply.ChunkHash.Add(ch.bytes);
            }
            ProtocolParser.WriteBytes(output, ReplyMessageList.SerializeToBytes(reply));
        }
Ejemplo n.º 2
0
        public override List <ChunkHash> GetMessageList(string prefix)
        {
            RequestMessageList msg = new RequestMessageList(prefix);

            SendMessage(msg);

            ReplyMessageList reply = ReplyMessageList.Deserialize(ProtocolParser.ReadBytes(input));
            List <ChunkHash> list  = new List <ChunkHash> ();

            foreach (byte[] hash in reply.ChunkHash)
            {
                list.Add(ChunkHash.FromHashBytes(hash));
            }

            return(list);
        }