Ejemplo n.º 1
0
        public static async Task StartConnection()
        {
            var hubUrls    = ConfigUtil.GetAppSettings <SourceHubUrls>("SourceHubUrls");
            var connection = new HubConnectionBuilder()
                             .WithUrl(hubUrls.Pk10)
                             .Build();

            connection.ServerTimeout = TimeSpan.FromMinutes(10);

            connection.On <JArray>("ShowPlans", BetPk10);

            try
            {
                await connection.StartAsync();

                await connection.InvokeAsync("RegisterAllRules");
            }
            catch (Exception ex)
            {
                ExceptionlessUtil.Fatal(ex, "模拟下注启动失败", true);
            }
        }