public void InitPCSServer(int port)
        {
            Server server = new Server
            {
                Services = { PCSServices.BindService(new PCSImpl(this)) },
                Ports    = { new ServerPort("localhost", port, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine(">>> PCS Server started");
        }
Пример #2
0
        static void Main()
        {
            // Enable Support For Unencrypted HTTP2
            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

            ParseArgs();
            var hp = Lib.ParseURL(URL);

            Grpc.Core.Server server = new Grpc.Core.Server {
                Services =
                {
                    PCSServices.BindService(new PCSServicesImpl(exeServer, exeClient))
                },
                Ports = { new ServerPort(hp[0], Convert.ToInt16(hp[1]), ServerCredentials.Insecure) }
            };
            server.Start();
            Lib.Block(URL);
        }