예제 #1
0
 public void Init()
 {
     server = new Server
     {
         Services = { Math.BindService(new MathServiceImpl()) },
         Ports = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
     };
     server.Start();
     channel = new Channel(Host, server.Ports.Single().BoundPort, Credentials.Insecure);
     client = Math.NewClient(channel);
 }
예제 #2
0
 public void Init()
 {
     server = new Server
     {
         Services = { Math.BindService(new MathServiceImpl()) },
         Ports    = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
     };
     server.Start();
     channel = new Channel(Host, server.Ports.Single().BoundPort, Credentials.Insecure);
     client  = Math.NewClient(channel);
 }
예제 #3
0
 public void Init()
 {
     // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
     server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
     {
         Services = { Math.BindService(new MathServiceImpl()) },
         Ports    = { { Host, ServerPort.PickUnused, ServerCredentials.Insecure } }
     };
     server.Start();
     channel = new Channel(Host, server.Ports.Single().BoundPort, ChannelCredentials.Insecure);
     client  = new Math.MathClient(channel);
 }
예제 #4
0
        public void Init()
        {
            server = new Server();
            server.AddServiceDefinition(Math.BindService(new MathServiceImpl()));
            int port = server.AddPort(host, Server.PickUnusedPort, ServerCredentials.Insecure);
            server.Start();
            channel = new Channel(host, port, Credentials.Insecure);
            client = Math.NewClient(channel);

            // TODO(jtattermusch): get rid of the custom header here once we have dedicated tests
            // for header support.
            client.HeaderInterceptor = (metadata) =>
            {
                metadata.Add(new Metadata.Entry("customHeader", "abcdef"));
            };
        }
예제 #5
0
        public void Init()
        {
            server = new Server();
            server.AddServiceDefinition(Math.BindService(new MathServiceImpl()));
            int port = server.AddListeningPort(host, Server.PickUnusedPort);

            server.Start();
            channel = new Channel(host, port);
            client  = Math.NewClient(channel);

            // TODO(jtattermusch): get rid of the custom header here once we have dedicated tests
            // for header support.
            client.HeaderInterceptor = (metadata) =>
            {
                metadata.Add(new Metadata.Entry("customHeader", "abcdef"));
            };
        }