/// <nodoc/>
        public void Start(int port)
        {
            var interceptor = new ServerInterceptor(m_loggingContext, m_buildId);

            m_server = new Server(ClientConnectionManager.ServerChannelOptions)
            {
                Services = { Orchestrator.BindService(this).Intercept(interceptor) },
                Ports    = { new ServerPort(IPAddress.Any.ToString(), port, ServerCredentials.Insecure) },
            };
            m_server.Start();
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override void Start(int port)
        {
            if (EngineEnvironmentSettings.GrpcKestrelServerEnabled)
            {
#if NET_COREAPP
                Action <object> configure = (endpoints) => ((IEndpointRouteBuilder)endpoints).MapGrpcService <GrpcOrchestrator>();
                _ = StartKestrel(port, configure);
#endif
            }
            else
            {
                var serviceDefinition = Orchestrator.BindService(m_grpcOrchestrator);
                Start(port, serviceDefinition);
            }
        }
Exemplo n.º 3
0
        static void Main()
        {
            Console.WriteLine("Starting orchestration server...");

            const int port = 30052;

            var server = new Server()
            {
                Services = { Orchestrator.BindService(new Services.OrchestratorService()) },
                Ports    = { new ServerPort("localhost", port, ServerCredentials.Insecure) }
            };

            server.Start();

            Console.WriteLine("Listening...");
            Console.WriteLine("Press any key to stop server...");
            Console.ReadKey(true);

            server.ShutdownAsync().Wait();
        }