public virtual void GlobalSetup() { Console.WriteLine($"Runs: {RunCount}"); var data = GetData(); _request = new InteropObject { Data = data }; _bpPackage = new PbInteropObject { ContentType = _request.ContentType, Data = ByteString.CopyFrom(data) }; }
public byte[] Process(byte[] request) { try { var p = PbInteropObject.Parser.ParseFrom(request); var res = new PbInteropObject { ContentType = p.ContentType, Data = p.Data }; return(res.ToByteArray()); } finally { Processing(); } }
internal static PbInteropObject ProcessPipe(NamedPipeServerStream pipe, PbInteropObject req) { try { if (!pipe.IsConnected) { throw new InvalidOperationException("Missing pipe client"); } req.WriteDelimitedTo(pipe); pipe.WaitForPipeDrain(); return(PbInteropObject.Parser.ParseDelimitedFrom(pipe)); } finally { Processing(); } }