You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
883 B

5 months ago
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));
5 months ago
public static PadarClient? _PadarClient;
5 months ago
public static void InitClient()
{
//TODO::查询 服务器 连接
Task.Run(() => { ConnClient(); });
}
5 months ago
5 months ago
private static void ConnClient()
{
PadarClient client = AppInfo.Container.Resolve<PadarClient>();
client.AutoReconnect = true;
5 months ago
client.InitBootstrap("192.168.3.55", int.Parse("2048"));
5 months ago
// client.InitBootstrap("127.0.0.1", int.Parse("2048"));
5 months ago
Task.Run(() =>
{
client.Connect();
5 months ago
_PadarClient = client;//
5 months ago
Log.Info($"succeed to connect Padar");
5 months ago
});
}
5 months ago
}