using System.Text; using Autofac; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac.Attribute; using Service.Charger.Msg.Host.Req; namespace Service.Charger.Client; /// /// 示例程序 /// [Scope("SingleInstance")] public class ClientMgr { public void InitClient() { Auth auth = new Auth(1, Encoding.UTF8.GetBytes("ddddddddd"), 1); auth.DestAddr = new byte[] { 0x01, 0x02, 0x03 }; ChargerClient chargerClient2 = AppInfo.Container.Resolve(); chargerClient2.InitBootstrap("127.0.0.1", 9998); chargerClient2.Connect(); chargerClient2.SessionAttr(12, 12, "12", "2"); chargerClient2.Channel.WriteAndFlushAsync(auth); ChargerServer chargerServer = AppInfo.Container.Resolve(); chargerServer.Start(9000); } }