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.

29 lines
895 B

using System.Text;
using Autofac;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkServices.Charger.Msg.Host.Req;
namespace HybirdFrameworkServices.Charger.Client;
/// <summary>
/// 示例程序
/// </summary>
[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<ChargerClient>();
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>();
chargerServer.Start(9000);
}
}