Exemplo n.º 1
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            var routes = RegisterRequest.GetRoutes(_endpointDataSource, new List <Type> {
                typeof(IGatewayService)
            });

            _gatewayController.SetGatewayRoutes(routes);

            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            _port = (uint)(_serverAddresses?.Addresses?.Select(address => {
                if (address.Contains(':'))
                {
                    return(int.Parse(address.Split(':').Last()));
                }

                return(address.StartsWith("https") ? 443 : 80);
            })?.FirstOrDefault() ?? 80);

            _routes = RegisterRequest.GetRoutes(_endpointDataSource, new List <Type> {
                typeof(ITestService)
            });

            _timer = new Timer(
                RegisterToGateway,
                null,
                TimeSpan.Zero,
                TimeSpan.FromMinutes(1)
                );

            return(Task.CompletedTask);
        }