public override ChunkHash GetCustomHash(CustomID customID) { RequestCustomHash msg = new RequestCustomHash(); msg.CustomID = customID.bytes; SendMessage(msg); byte[] rbytes = ProtocolParser.ReadBytes(input); //Console.WriteLine("Got reply " + rbytes.Length); ReplyCustomHash reply = ReplyCustomHash.Deserialize(rbytes); //Console.WriteLine("Got reply " + reply); return(ChunkHash.FromHashBytes(reply.ChunkHash)); }
void ProcessGetCustomHash() { RequestCustomHash request = RequestCustomHash.Deserialize(ProtocolParser.ReadBytes(input)); ReplyCustomHash reply = new ReplyCustomHash(); ChunkHash ch = localRepo.GetCustomHash(CustomID.FromBytes(request.CustomID)); if (ch == null) { reply.ChunkHash = null; } else { reply.ChunkHash = ch.bytes; } //Console.Error.WriteLine("PipeServer: Sending: " + reply); byte[] rbytes = ReplyCustomHash.SerializeToBytes(reply); //Console.Error.WriteLine("PipeServer: Sending: " + rbytes.Length + ", " + BitConverter.ToString(rbytes)); ProtocolParser.WriteBytes(output, rbytes); }