Exemple #1
0
        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)
            };
        }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 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();
     }
 }