コード例 #1
0
        public StateManagement()
        {
            HttpClientHandler httpHandler = new HttpClientHandler();

            httpHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;

            GrpcChannel channel = GrpcChannel.ForAddress("https://192.168.0.145:5003", new GrpcChannelOptions {
                HttpHandler = httpHandler
            });

            client = new Input.InputClient(channel);
        }
コード例 #2
0
        public InputMonitorService(HWInterface hw, ILogger <InputMonitorService> logger, IConfiguration configuration)
        {
            this.hw            = hw;
            this.logger        = logger;
            this.configuration = configuration;
            var httpHandler = new HttpClientHandler();

            httpHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
            // Todo: get server address from appsettings.
            GrpcChannel channel = GrpcChannel.ForAddress("https://192.168.0.145:5003", new GrpcChannelOptions {
                HttpHandler = httpHandler
            });

            client = new Input.InputClient(channel);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var httpHandler = new HttpClientHandler();

            httpHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;

            GrpcChannel channel = GrpcChannel.ForAddress("https://localhost:5003", new GrpcChannelOptions {
                HttpHandler = httpHandler
            });

            client = new Input.InputClient(channel);

            Timer timer = new Timer(1000);

            timer.Elapsed  += CheckInputs;
            timer.AutoReset = true;
            timer.Enabled   = true;

            Console.WriteLine("Timer started");

            Console.ReadKey();
        }