using Autofac; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac.Attribute; using log4net; namespace Service.Padar.Client; [Scope] public class PadarMgr { private static readonly ILog Log = LogManager.GetLogger(typeof(PadarMgr)); public static PadarClient? _PadarClient; public static void InitClient() { //TODO::查询 服务器 连接 Task.Run(() => { ConnClient(); }); } private static void ConnClient() { PadarClient client = AppInfo.Container.Resolve(); client.AutoReconnect = true; //client.InitBootstrap("192.168.3.55", int.Parse("2048")); client.InitBootstrap("127.0.0.1", int.Parse("2048"), 10,0, 0); Task.Run(() => { client.Connect(); _PadarClient = client;// Log.Info($"succeed to connect Padar"); }); } }