public void Init() { GrpcEnvironment.Initialize(); server = new Server(); server.AddServiceDefinition(MathGrpc.BindService(new MathServiceImpl())); int port = server.AddPort(host + ":0"); server.Start(); channel = new Channel(host + ":" + port); client = MathGrpc.NewStub(channel); }
public void Init() { GrpcEnvironment.Initialize(); server = new Server(); server.AddServiceDefinition(MathGrpc.BindService(new MathServiceImpl())); int port = server.AddListeningPort(host + ":0"); server.Start(); channel = new Channel(host + ":" + port); // TODO: get rid of the custom header here once we have dedicated tests // for header support. var stubConfig = new StubConfiguration((headerBuilder) => { headerBuilder.Add(new Metadata.MetadataEntry("customHeader", "abcdef")); }); client = MathGrpc.NewStub(channel, stubConfig); }